Make sure to sign out external users if an error occurs during sign-in (#14867)

This commit is contained in:
Kenn Jacobsen
2023-09-28 13:25:11 +02:00
committed by GitHub
parent 158cef1692
commit 7be1852827

View File

@@ -585,6 +585,11 @@ public class BackOfficeController : UmbracoController
if (errors.Count > 0)
{
// the external user might actually be signed in at this point, but certain errors (i.e. missing claims)
// prevents us from applying said user to a back-office session. make sure the sign-in manager does not
// report the user as being signed in for subsequent requests.
await _signInManager.SignOutAsync();
ViewData.SetExternalSignInProviderErrors(
new BackOfficeExternalLoginProviderErrors(
loginInfo.LoginProvider,