-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Blazor] Support state in NavigationManager #42534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs
Outdated
Show resolved
Hide resolved
0ee7fd6
to
6aa5aab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I know it would be annoying to go through CI all over again just to change one XML doc, so I totally understand if you prefer not to block this PR on it. If you wouldn't mind making that small tweak in your follow-up PR for auth, that would be great.
It's ok, I had to update the JS files which I forgot after the rename, so I have updated the remarks to bring it inline with what the remarks on other properties mention. |
Fixes #42617
Adds support for passing
state
during navigations via navigation manager and updates the authentication infrastructure to make use of it.The previous authentication infrastructure implementation used JS interop and sessionStorage and the URL query string to pass data between authentication states.
This was brittle and required extra work to avoid things like CSRF logouts or to encode/decode error messages on the error UI states.
The new NavigationManager API simplifies associating a state that is associated with the navigation entry and not with the session (like sessionStorage) and allows simple communication between different pages with the benefit that there is no cleanup needed.
Part of the improvements on the auth system are going to rely on this to pass data from other pages to the authentication pages, but since this change is general purpose and a net positive, I separated it into its own PR.