Skip to content

Commit

Permalink
Added null check for external login invocation when linking users.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyButland committed Nov 15, 2021
1 parent 3d43815 commit c6176a0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ private async Task<SignInResult> AutoLinkAndSignInExternalAccount(ExternalLoginI
return AutoLinkSignInResult.FailedException(ex.Message);
}

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

0 comments on commit c6176a0

Please sign in to comment.