diff --git a/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs b/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs index 391769361..c693c2be1 100644 --- a/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs +++ b/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs @@ -29,13 +29,6 @@ namespace BTCPayServer.Security.APIKeys protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, PolicyRequirement requirement) { - //if it is a create user request, and the auth is not specified, and there are no admins in the system: authorize - if (context.User.Identity.AuthenticationType == null && requirement.Policy == Policies.CanCreateUser.Key && - !(await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin)).Any()) - { - context.Succeed(requirement); - } - if (context.User.Identity.AuthenticationType != APIKeyConstants.AuthenticationType) return;