I have a Blazor WASM(hereinafter app), ASP Hosted project with identity server authorization. I need the user must log in before showing app. So I in NotAuthorized section of AuthorizeRouteView in App.razor add redirect to login.
The problem with this approach is that the app loads first, redirects to a login page that is not part of the application, and after logging in, redirects back and reloads the entire app, which significantly slows down the initial process of logging in and launching the application.
So my question is: Is there a better solution which avoid double loading of the whole app?