mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
GreenField: Remove requirement for permissions >= 1 when creating key
Sometimes you just want to have an api key to verify a user still exists periodically on a server and do not need any permissions
This commit is contained in:
parent
9d1cd085ea
commit
c2a4bc2603
@ -45,11 +45,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
{
|
||||
if (request is null)
|
||||
return NotFound();
|
||||
if (request.Permissions is null || request.Permissions.Length == 0)
|
||||
{
|
||||
ModelState.AddModelError(nameof(request.Permissions), "One or more permissions are required");
|
||||
return this.CreateValidationError(ModelState);
|
||||
}
|
||||
request.Permissions ??= System.Array.Empty<Permission>();
|
||||
var key = new APIKeyData()
|
||||
{
|
||||
Id = Encoders.Hex.EncodeData(RandomUtils.GetBytes(20)),
|
||||
|
Loading…
Reference in New Issue
Block a user