diff --git a/src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs b/src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs index e32a556c1bcd..ec0d273b561c 100644 --- a/src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs +++ b/src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs @@ -194,14 +194,14 @@ private async Task 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 @@ -236,14 +236,14 @@ private async Task 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; } } }