Guest User

Untitled

a guest
Nov 3rd, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. @using Microsoft.AspNetCore.Components.Authorization
  2.  
  3. <CascadingAuthenticationState>
  4.     <Router AppAssembly="@typeof(App).Assembly">
  5.         <Found Context="routeData">
  6.             <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
  7.                 <NotAuthorized>
  8.                     <RedirectToLogin />
  9.                    
  10.                     <MudText Typo="Typo.h3">Not Authorized!</MudText>
  11.                 </NotAuthorized>
  12.  
  13.             </AuthorizeRouteView>
  14.         </Found>
  15.         <NotFound>
  16.             <PageTitle>Not found</PageTitle>
  17.             <LayoutView Layout="@typeof(MainLayout)">
  18.                 <p role="alert">Sorry, there's nothing at this address.</p>
  19.            </LayoutView>
  20.        </NotFound>
  21.    </Router>
  22. </CascadingAuthenticationState>
Advertisement
Add Comment
Please, Sign In to add comment