Update the HttpContext's user with the authenticated user's principal

This commit is contained in:
Elitsa
2024-08-20 10:15:37 +02:00
committed by Nikolaj Geisle
parent c9021ab2d2
commit 8c1128c85b

View File

@@ -59,6 +59,14 @@ public static class HttpContextExtensions
await httpContext.AuthenticateAsync(Constants.Security.BackOfficeExternalAuthenticationType);
}
// Update the HttpContext's user with the authenticated user's principal to ensure
// that subsequent requests within the same context will recognize the user
// as authenticated.
if (result.Succeeded)
{
httpContext.User = result.Principal;
}
return result;
}