Can't check IsTwoFactorClientRemembered when in ServerInteractive mode #52416
Unanswered
geistchevalier
asked this question in
Q&A
Replies: 1 comment
-
I´d like to know that too. Got the same problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm playing around with server side render Blazor the new .net 8.0, I noticed that if I set the rendermode of my login page (login.razor) to
@rendermode InteractiveServer
, causes it to throw an error when I runawait SignInManager.IsTwoFactorClientRememberedAsync
in a separate injected helper class (loginhelper.cs). It would fail with the message ofonstarting cannot be set because the response has already started
.Drilling down I found that it would fail at
SignInManager<TUser>.Context.AuthenticateAsync(IdentityConstants.TwoFactorRememberMeScheme)
It executes just fine if I removed the
@rendermode InteractiveServer
I understand enough to recognize that this is related to the HttpContext, but not enough to understand the flow to think of a fix/workaround. Is my only option to remove the
InteractiveServer
rendermode if I want to check if the current user passes theIsTwoFactorClientRememberedAsync
check?Beta Was this translation helpful? Give feedback.
All reactions