Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Moiseev <vladdy-moses@users.noreply.github.com>2022-11-03 21:30:46 +0300
committerGitHub <noreply@github.com>2022-11-03 21:30:46 +0300
commitea1391ad73c76bd709ee0cf190cc5347387ffef6 (patch)
treeea41425bb1a7d718446a224ba0111f5ba468dbf9
parent04bb460447cc6b84ec88080a777b298ba70ce7d7 (diff)
Fix invalid redirection after 2FA signin (#44395) (#44435)
-rw-r--r--src/Identity/Core/src/IdentityCookiesBuilderExtensions.cs4
-rw-r--r--src/Identity/Core/src/IdentityServiceCollectionExtensions.cs4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/Identity/Core/src/IdentityCookiesBuilderExtensions.cs b/src/Identity/Core/src/IdentityCookiesBuilderExtensions.cs
index 91f83d012c..ce4275e10f 100644
--- a/src/Identity/Core/src/IdentityCookiesBuilderExtensions.cs
+++ b/src/Identity/Core/src/IdentityCookiesBuilderExtensions.cs
@@ -100,6 +100,10 @@ public static class IdentityCookieAuthenticationBuilderExtensions
builder.AddCookie(IdentityConstants.TwoFactorUserIdScheme, o =>
{
o.Cookie.Name = IdentityConstants.TwoFactorUserIdScheme;
+ o.Events = new CookieAuthenticationEvents
+ {
+ OnRedirectToReturnUrl = _ => Task.CompletedTask
+ };
o.ExpireTimeSpan = TimeSpan.FromMinutes(5);
});
return new OptionsBuilder<CookieAuthenticationOptions>(builder.Services, IdentityConstants.TwoFactorUserIdScheme);
diff --git a/src/Identity/Core/src/IdentityServiceCollectionExtensions.cs b/src/Identity/Core/src/IdentityServiceCollectionExtensions.cs
index 5cf717b3c3..ee8c3d9569 100644
--- a/src/Identity/Core/src/IdentityServiceCollectionExtensions.cs
+++ b/src/Identity/Core/src/IdentityServiceCollectionExtensions.cs
@@ -72,6 +72,10 @@ public static class IdentityServiceCollectionExtensions
.AddCookie(IdentityConstants.TwoFactorUserIdScheme, o =>
{
o.Cookie.Name = IdentityConstants.TwoFactorUserIdScheme;
+ o.Events = new CookieAuthenticationEvents
+ {
+ OnRedirectToReturnUrl = _ => Task.CompletedTask
+ };
o.ExpireTimeSpan = TimeSpan.FromMinutes(5);
});