From 754fa085260ad60ea18e198723de1cde934f61fa Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Wed, 11 Dec 2024 15:17:38 -0800 Subject: [PATCH] Fix intermittent redirects during external auto-login Fix #17219 --- .../OrchardCore.Users/Services/ExternalLoginFormEvents.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Services/ExternalLoginFormEvents.cs b/src/OrchardCore.Modules/OrchardCore.Users/Services/ExternalLoginFormEvents.cs index 7b0ed6f0ffa..23c03f4927d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Services/ExternalLoginFormEvents.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Services/ExternalLoginFormEvents.cs @@ -35,6 +35,14 @@ public ExternalLoginFormEvents( _httpContextAccessor = httpContextAccessor; } + public override Task LoggedInAsync(IUser user) + { + var tempData = _tempDataDictionaryFactory.GetTempData(_httpContextAccessor.HttpContext); + tempData.Remove(ExternalLoginAutoRedirectKeyName); + + return Task.CompletedTask; + } + public override async Task LoggingInAsync() { if (!_externalLoginOptions.UseExternalProviderIfOnlyOneDefined)