Updated front-end authentication.

This commit is contained in:
2026-02-22 21:47:34 -05:00
parent 8348603b13
commit 80ca1296e5
13 changed files with 184 additions and 56 deletions

View File

@@ -1,4 +1,5 @@
@using JSMR.UI.Blazor.Services
@using JSMR.UI.Blazor.Components.Authentication
@using JSMR.UI.Blazor.Services
@inject SessionState Session
@@ -6,22 +7,24 @@
<RadzenTheme Theme="material-dark" />
</HeadContent>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
<AuthenticationGate>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</AuthenticationGate>
@code {
protected override async Task OnInitializedAsync()
{
await Session.RefreshAsync();
//await Session.RefreshAsync();
}
}