Revise if-else order in RemoteAuthenticateHandler

This commit is contained in:
Troy Dai 2016-07-26 16:27:28 -07:00
parent 0e855b25a8
commit 763df65c14
1 changed files with 5 additions and 6 deletions

View File

@ -37,18 +37,17 @@ namespace Microsoft.AspNetCore.Authentication
try
{
var authResult = await HandleRemoteAuthenticateAsync();
if (authResult != null && authResult.Skipped)
{
return false;
}
if (authResult == null)
{
exception = new InvalidOperationException("Invalid return state, unable to redirect.");
}
else if (authResult.Skipped)
{
return false;
}
else if (!authResult.Succeeded)
{
exception = authResult?.Failure ??
exception = authResult.Failure ??
new InvalidOperationException("Invalid return state, unable to redirect.");
}