I am trying to create a new application in Blazor and am working on authentication. I am using a JWT tokens that is stored in Local storage. When the application loads i need to
A solution (for now, not the best i think?) is to create a base class for all component pages to inherit from and override the OnInit method to do the checks and redirects. This also works when navigating to a link after the application has loaded.
A check in the app.cshtml component only works for the initial startup, not when navigating within the application. This would be nice for other checks, but not to protect routes.