1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2026-01-12 08:58:15 +01:00
Files
Minecraft-Phantom-Panel/Web/Phantom.Web/App.razor
2025-12-29 23:26:51 +01:00

23 lines
859 B
Plaintext

@using Phantom.Web.Errors
@using Phantom.Web.Services
@inject Navigation Navigation
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(NotFound)">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
@if (context.User.Identity is { IsAuthenticated: true }) {
<h1>Forbidden</h1>
<p role="alert">You do not have permission to visit this page.</p>
}
else {
_ = Navigation.NavigateTo("login" + QueryString.Create("return", Navigation.CreateReturnUrl()), forceLoad: true);
}
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>
</CascadingAuthenticationState>