Skip to content

Commit

Permalink
Inverted conditional on linking user for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyButland committed Nov 15, 2021
1 parent c6176a0 commit fe396ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ private async Task<SignInResult> AutoLinkAndSignInExternalAccount(ExternalLoginI
}

var shouldLinkUser = autoLinkOptions.OnExternalLogin == null || autoLinkOptions.OnExternalLogin(autoLinkUser, loginInfo);
if (shouldLinkUser == false)
if (shouldLinkUser)
{
LogFailedExternalLogin(loginInfo, autoLinkUser);
return ExternalLoginSignInResult.NotAllowed;
return await LinkUser(autoLinkUser, loginInfo);
}
else
{
return await LinkUser(autoLinkUser, loginInfo);
LogFailedExternalLogin(loginInfo, autoLinkUser);
return ExternalLoginSignInResult.NotAllowed;
}
}
else
Expand Down Expand Up @@ -236,14 +236,14 @@ private async Task<SignInResult> AutoLinkAndSignInExternalAccount(ExternalLoginI
else
{
var shouldLinkUser = autoLinkOptions.OnExternalLogin == null || autoLinkOptions.OnExternalLogin(autoLinkUser, loginInfo);
if (shouldLinkUser == false)
if (shouldLinkUser)
{
LogFailedExternalLogin(loginInfo, autoLinkUser);
return ExternalLoginSignInResult.NotAllowed;
return await LinkUser(autoLinkUser, loginInfo);
}
else
{
return await LinkUser(autoLinkUser, loginInfo);
LogFailedExternalLogin(loginInfo, autoLinkUser);
return ExternalLoginSignInResult.NotAllowed;
}
}
}
Expand Down

0 comments on commit fe396ba

Please sign in to comment.