Fix warnings

This commit is contained in:
nicolas.dorier
2021-12-27 13:46:31 +09:00
parent 259f0b5aad
commit c0e9f91bdc
15 changed files with 115 additions and 130 deletions

View File

@@ -91,11 +91,12 @@ namespace BTCPayServer.Controllers.GreenField
}
if (request.Password is null)
ModelState.AddModelError(nameof(request.Password), "Password is missing");
if (!ModelState.IsValid)
{
return this.CreateValidationError(ModelState);
}
if (User.Identity is null)
throw new JsonHttpException(this.StatusCode(401));
var anyAdmin = (await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin)).Any();
var policies = await _settingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
var isAuth = User.Identity.AuthenticationType == GreenFieldConstants.AuthenticationType;