Neighbourhood.omg.lol/Components/Routes.razor
Gordon Pedersen 5fb95c8305 Added auth.
Unfortunately it does not refresh at first login. Have to figure out how to make it refresh
2024-05-31 23:16:09 +10:00

18 lines
693 B
Text

@using Microsoft.AspNetCore.Components.Authorization
<Router AppAssembly="@typeof(MauiProgram).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<Authorizing>Logging in...</Authorizing>
<NotAuthorized><RedirectToLogin /></NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<CascadingAuthenticationState>
<LayoutView Layout="@typeof(Layout.MainLayout)">
<img data-emoji="🦒" />
<p>Sorry, there's nothing here.</p>
</LayoutView>
</CascadingAuthenticationState>
</NotFound>
</Router>