App.razor 886 B

1234567891011121314151617181920212223
  1. <CascadingAuthenticationState>
  2. <Router AppAssembly="@typeof(Program).Assembly" AdditionalAssemblies="new[] { typeof(MainLayout).Assembly }">
  3. <Found Context="routeData">
  4. <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
  5. <NotAuthorized>
  6. @if (!context.User.Identity.IsAuthenticated)
  7. {
  8. <RedirectToLogin />
  9. }
  10. else
  11. {
  12. <p>You are not authorized to access this resource.</p>
  13. }
  14. </NotAuthorized>
  15. </AuthorizeRouteView>
  16. </Found>
  17. <NotFound>
  18. <LayoutView Layout="@typeof(MainLayout)">
  19. <p>Sorry, there's nothing at this address.</p>
  20. </LayoutView>
  21. </NotFound>
  22. </Router>
  23. </CascadingAuthenticationState>