mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 15:14:49 +01:00
Merge pull request #1746 from btcpayserver/api/fix-keys-requirement
GreenField: Remove requirement for permissions >= 1 when creating key
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user