From 6c3b9b77c637b9430e77f55b1f1f12dc2556c209 Mon Sep 17 00:00:00 2001
From: Christophe
Date: Mon, 13 Apr 2026 22:42:17 +0200
Subject: [PATCH] Ajout des acces connexion et inscription sur l'accueil
---
ChessCubing.App/App.razor | 38 ++++++++++++-------
.../Components/UserAccessBar.razor | 2 +
ChessCubing.App/Pages/Home.razor | 4 ++
README.md | 2 +
keycloak/realm/chesscubing-realm.json | 2 +-
styles.css | 4 ++
6 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/ChessCubing.App/App.razor b/ChessCubing.App/App.razor
index 5bdf683..4c3c75c 100644
--- a/ChessCubing.App/App.razor
+++ b/ChessCubing.App/App.razor
@@ -1,20 +1,32 @@
-
-
-
-
- Authentification
- Verification de la session en cours...
-
-
-
-
-
-
-
+ @if (RequiresAuthorization(routeData.PageType))
+ {
+
+
+
+
+ Authentification
+ Verification de la session en cours...
+
+
+
+
+
+
+
+ }
+ else
+ {
+
+ }
+
+@code {
+ private static bool RequiresAuthorization(Type pageType)
+ => Attribute.IsDefined(pageType, typeof(AuthorizeAttribute), inherit: true);
+}
diff --git a/ChessCubing.App/Components/UserAccessBar.razor b/ChessCubing.App/Components/UserAccessBar.razor
index f75a4ec..f1849f3 100644
--- a/ChessCubing.App/Components/UserAccessBar.razor
+++ b/ChessCubing.App/Components/UserAccessBar.razor
@@ -23,6 +23,7 @@
@@ -30,6 +31,7 @@
@code {
private string LoginHref => BuildAuthHref("login", CurrentReturnUrl);
+ private string RegisterHref => BuildAuthHref("register", CurrentReturnUrl);
private string LogoutHref => BuildAuthHref("logout", "/");
private string CurrentReturnUrl
diff --git a/ChessCubing.App/Pages/Home.razor b/ChessCubing.App/Pages/Home.razor
index a5f7b22..9db2586 100644
--- a/ChessCubing.App/Pages/Home.razor
+++ b/ChessCubing.App/Pages/Home.razor
@@ -24,6 +24,10 @@
+
Lire le reglement
Ouvrir l'appli d'Ethan
Ouvrir l'appli de Brice
diff --git a/README.md b/README.md
index 18b9048..d36db31 100644
--- a/README.md
+++ b/README.md
@@ -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
- 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
- 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`
- client public OIDC : `chesscubing-web`
- roles de realm : `admin`, `organizer`, `player`
+- inscription utilisateur : activee
La gestion des utilisateurs se fait ensuite dans la console d'administration Keycloak.
diff --git a/keycloak/realm/chesscubing-realm.json b/keycloak/realm/chesscubing-realm.json
index b78bd10..86472a1 100644
--- a/keycloak/realm/chesscubing-realm.json
+++ b/keycloak/realm/chesscubing-realm.json
@@ -2,7 +2,7 @@
"realm": "chesscubing",
"enabled": true,
"displayName": "ChessCubing",
- "registrationAllowed": false,
+ "registrationAllowed": true,
"rememberMe": true,
"resetPasswordAllowed": true,
"loginWithEmailAllowed": true,
diff --git a/styles.css b/styles.css
index a626911..f9f2882 100644
--- a/styles.css
+++ b/styles.css
@@ -1047,6 +1047,10 @@ body[data-page="cube"] .zone-button.cube-hold-ready::after {
margin-top: 1.2rem;
}
+.hero-actions-utility {
+ margin-top: 0.75rem;
+}
+
.user-access-bar {
display: grid;
gap: 0.9rem;