From fe396ba0cf5c51ea27b5ce145e62f5537c1bed8d Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Mon, 15 Nov 2021 11:45:00 +0100 Subject: [PATCH] Inverted conditional on linking user for clarity. --- .../Security/BackOfficeSignInManager.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; } } }