Rendre le site public et restaurer les acces compte

This commit is contained in:
2026-04-13 22:52:08 +02:00
parent 1d0a3f551f
commit 525f804e0b
8 changed files with 34 additions and 34 deletions

View File

@@ -1,32 +1,8 @@
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(Pages.NotFound)">
<Found Context="routeData">
@if (RequiresAuthorization(routeData.PageType))
{
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<Authorizing>
<main class="rules-shell">
<section class="panel panel-wide cta-panel" style="margin-top: 2rem;">
<p class="eyebrow">Authentification</p>
<h1>Verification de la session en cours...</h1>
</section>
</main>
</Authorizing>
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
}
else
{
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
}
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>
</CascadingAuthenticationState>
@code {
private static bool RequiresAuthorization(Type pageType)
=> Attribute.IsDefined(pageType, typeof(AuthorizeAttribute), inherit: true);
}