Blazor Server .NET 8: How to properly access ProtectedLocalStorage after login using NavigationManager.NavigateTo()
After successful login (JWT-based authentication stored in protectedLocalStorage
), I want to redirect to ReturnUrl
if exists.
Blazor Web App .NET 8: How to properly access ProtectedLocalStorage after login using NavigationManager.NavigateTo()
After implementing login logic (JWT-based authentication), I want to redirect to ReturnUrl
if exists. The ReturnUrl
has Authorize
attribute, but when GetAuthenticationStateAsync()
is executed, protectedLocalStorage
is null
after NavigationManager.NavigateTo()
is executed.
How to properly access ProtectedLocalStorage after NavigationManager.NavigateTo()
After implementing login logic, I want to redirect to ReturnUrl
if exists. The ReturnUrl
has Authorize
attribute, but when GetAuthenticationStateAsync()
is executed, protectedLocalStorage
is null after NavigationManager.NavigateTo()
is executed.