Code simplification

This commit is contained in:
nicolas.dorier 2018-12-06 12:26:42 +09:00
parent 65b4697229
commit 8198f98376

View File

@ -65,18 +65,14 @@ namespace BTCPayServer.Security
{ {
var result = await CheckBitId(Context.Request.HttpContext, bitpayAuth.Signature, bitpayAuth.Id, claims); var result = await CheckBitId(Context.Request.HttpContext, bitpayAuth.Signature, bitpayAuth.Id, claims);
storeId = result.StoreId; storeId = result.StoreId;
failedAuth = !result.SuccessAuth;
successAuth = result.SuccessAuth; successAuth = result.SuccessAuth;
failedAuth = !successAuth;
} }
else if (!string.IsNullOrEmpty(bitpayAuth.Authorization)) else if (!string.IsNullOrEmpty(bitpayAuth.Authorization))
{ {
storeId = await CheckLegacyAPIKey(Context.Request.HttpContext, bitpayAuth.Authorization); storeId = await CheckLegacyAPIKey(Context.Request.HttpContext, bitpayAuth.Authorization);
if (storeId == null)
{
Logs.PayServer.LogDebug("API key check failed");
failedAuth = true;
}
successAuth = storeId != null; successAuth = storeId != null;
failedAuth = !successAuth;
} }
if (failedAuth) if (failedAuth)