Ajout des acces connexion et inscription sur l'accueil
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
<CascadingAuthenticationState>
|
<CascadingAuthenticationState>
|
||||||
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(Pages.NotFound)">
|
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(Pages.NotFound)">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
|
@if (RequiresAuthorization(routeData.PageType))
|
||||||
|
{
|
||||||
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
|
||||||
<Authorizing>
|
<Authorizing>
|
||||||
<main class="rules-shell">
|
<main class="rules-shell">
|
||||||
@@ -14,7 +16,17 @@
|
|||||||
<RedirectToLogin />
|
<RedirectToLogin />
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
</AuthorizeRouteView>
|
</AuthorizeRouteView>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
|
||||||
|
}
|
||||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||||
</Found>
|
</Found>
|
||||||
</Router>
|
</Router>
|
||||||
</CascadingAuthenticationState>
|
</CascadingAuthenticationState>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private static bool RequiresAuthorization(Type pageType)
|
||||||
|
=> Attribute.IsDefined(pageType, typeof(AuthorizeAttribute), inherit: true);
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="user-access-actions">
|
<div class="user-access-actions">
|
||||||
<a class="button primary small" href="@LoginHref">Se connecter</a>
|
<a class="button primary small" href="@LoginHref">Se connecter</a>
|
||||||
|
<a class="button ghost small" href="@RegisterHref">Creer un compte</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
private string LoginHref => BuildAuthHref("login", CurrentReturnUrl);
|
private string LoginHref => BuildAuthHref("login", CurrentReturnUrl);
|
||||||
|
private string RegisterHref => BuildAuthHref("register", CurrentReturnUrl);
|
||||||
private string LogoutHref => BuildAuthHref("logout", "/");
|
private string LogoutHref => BuildAuthHref("logout", "/");
|
||||||
|
|
||||||
private string CurrentReturnUrl
|
private string CurrentReturnUrl
|
||||||
|
|||||||
@@ -24,6 +24,10 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="hero-actions">
|
<div class="hero-actions">
|
||||||
<a class="button primary" href="application.html">Ouvrir l'application</a>
|
<a class="button primary" href="application.html">Ouvrir l'application</a>
|
||||||
|
<a class="button secondary" href="authentication/login?returnUrl=%2Fapplication.html">Se connecter</a>
|
||||||
|
<a class="button ghost" href="authentication/register?returnUrl=%2Fapplication.html">Creer un compte</a>
|
||||||
|
</div>
|
||||||
|
<div class="hero-actions hero-actions-utility">
|
||||||
<a class="button secondary" href="reglement.html">Lire le reglement</a>
|
<a class="button secondary" href="reglement.html">Lire le reglement</a>
|
||||||
<a class="button ghost" href="/ethan/">Ouvrir l'appli d'Ethan</a>
|
<a class="button ghost" href="/ethan/">Ouvrir l'appli d'Ethan</a>
|
||||||
<a class="button ghost" href="/brice/">Ouvrir l'appli de Brice</a>
|
<a class="button ghost" href="/brice/">Ouvrir l'appli de Brice</a>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ L'application embarque maintenant une authentification OpenID Connect basee sur
|
|||||||
|
|
||||||
- les pages `application.html`, `chrono.html` et `cube.html` demandent une connexion
|
- les pages `application.html`, `chrono.html` et `cube.html` demandent une connexion
|
||||||
- la page d'accueil et la page reglement affichent l'etat de session courant
|
- la page d'accueil et la page reglement affichent l'etat de session courant
|
||||||
|
- la page d'accueil propose directement des actions `Se connecter` et `Creer un compte`
|
||||||
- les roles Keycloak du realm sont exposes dans l'application
|
- les roles Keycloak du realm sont exposes dans l'application
|
||||||
- l'etat du match est isole par utilisateur dans le navigateur grace a une cle de stockage derivee du compte connecte
|
- l'etat du match est isole par utilisateur dans le navigateur grace a une cle de stockage derivee du compte connecte
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ Le realm importe par defaut :
|
|||||||
- realm : `chesscubing`
|
- realm : `chesscubing`
|
||||||
- client public OIDC : `chesscubing-web`
|
- client public OIDC : `chesscubing-web`
|
||||||
- roles de realm : `admin`, `organizer`, `player`
|
- roles de realm : `admin`, `organizer`, `player`
|
||||||
|
- inscription utilisateur : activee
|
||||||
|
|
||||||
La gestion des utilisateurs se fait ensuite dans la console d'administration Keycloak.
|
La gestion des utilisateurs se fait ensuite dans la console d'administration Keycloak.
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"realm": "chesscubing",
|
"realm": "chesscubing",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"displayName": "ChessCubing",
|
"displayName": "ChessCubing",
|
||||||
"registrationAllowed": false,
|
"registrationAllowed": true,
|
||||||
"rememberMe": true,
|
"rememberMe": true,
|
||||||
"resetPasswordAllowed": true,
|
"resetPasswordAllowed": true,
|
||||||
"loginWithEmailAllowed": true,
|
"loginWithEmailAllowed": true,
|
||||||
|
|||||||
@@ -1047,6 +1047,10 @@ body[data-page="cube"] .zone-button.cube-hold-ready::after {
|
|||||||
margin-top: 1.2rem;
|
margin-top: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hero-actions-utility {
|
||||||
|
margin-top: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
.user-access-bar {
|
.user-access-bar {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.9rem;
|
gap: 0.9rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user