Rendre le site public et restaurer les acces compte
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user