❔ AspNetCore.Components.NavigationException

Hey everyone,

I'm currently working on a Blazor project and using Identity for IAM. However, I've designed my own login and signup pages instead of relying on the Identity UI.

To ensure that users are redirected to my custom pages instead of the Identity UI when they're not authenticated, I've developed a simple component (refer to Screenshot_1). This component is then embedded within the NotAuthorized tag in App.razor (take a look at Screenshot_2).

Now, I'm encountering an issue. As soon as I launch the site, even before the UI is rendered, I encounter a NavigationException exception labeled as "Exception_WasThrown" (thanks, Microsoft!). Clicking "continue" leads me to the login screen as expected. However, after creating an account and logging in, instead of taking me to the authenticated UI, it briefly displays the authenticated UI and then reverts back to the login page, triggering the same exception again.

I've been trying to find more information about this exception and the concept of using a custom page in place of the Identity UI, but I'm coming up short. Could anyone offer any insights or advice on this matter? Your help would be greatly appreciated!
Screenshot_1.png
Screenshot_2.png
Was this page helpful?