Closed mghammer40 closed 2 months ago
@mghammer40 thanks for contacting us.
Have you implemented a RevalidatingAuthenticationStateProvider
? See https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/?view=aspnetcore-8.0&tabs=visual-studio#manage-authentication-state-in-blazor-web-apps and https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/?view=aspnetcore-8.0&tabs=visual-studio#additional-security-abstractions for details.
Hi @mghammer40. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
See our Issue Management Policies for more information.
Is there an existing issue for this?
Describe the bug
Hello, I created simple blazor project with cookie authentication to visualize the problem. Inside I have only four pages Home, Start, Login and Logout. Additionally I modified MainLayout to show login and logout links.
Simple home page
Start page with EditForm and AuthorizeView
Login with simple cookie authentication
Logout
Program.cs
First I login using login page and I am redirected to start page. Then I click on logout from start page. I am redirected to home page. Next I need to click fast on start page link and I am redirected to start page. Now authentication on page is split in two. Mainlayout showing correct login button as it is NotAuthorized, but Start.razor component is showing as authorized and is returning AuthenticationState as authorized. This dont occur when I wait few seconds after logout and clicking start and page is rendering corectly as NotAuthorized. I'm new to Blazor and I'm wonder if this is intentional or not.
Expected Behavior
AuthorizeView inside component should refresh when accessed?
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
8.0.7
Anything else?
No response