Rewrite the BitpayAuthHandler more clearly

This commit is contained in:
nicolas.dorier 2019-03-25 12:08:47 +09:00
parent 873c0a183a
commit 4d7e9d3f8a

View File

@ -71,9 +71,7 @@ namespace BTCPayServer.Security
success = storeId != null;
}
if (success.HasValue)
{
if (success.Value)
if (success is true)
{
if (storeId != null)
{
@ -84,11 +82,11 @@ namespace BTCPayServer.Security
}
return AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(new ClaimsIdentity(claims, Policies.BitpayAuthentication)), Policies.BitpayAuthentication));
}
else
else if (success is false)
{
return AuthenticateResult.Fail("Invalid credentials");
}
}
// else if (success is null)
}
return AuthenticateResult.NoResult();
}