Skip to content

Instantly share code, notes, and snippets.

@explorer14
Created August 24, 2020 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/c90462b6452f48eb138b6907d676f71e to your computer and use it in GitHub Desktop.
Save explorer14/c90462b6452f48eb138b6907d676f71e to your computer and use it in GitHub Desktop.
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
@{
NavMgr.NavigateTo("/login");
}
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<CascadingAuthenticationState>
<LayoutView Layout="@typeof(NotFoundLayout)">
<p>Oops! That page wasn't found! You may want to return <a href="/">Home</a></p>
</LayoutView>
</CascadingAuthenticationState>
</NotFound>
</Router>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment