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 @@
Se connecter + Creer un compte
@@ -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 @@

Ouvrir l'application + Se connecter + Creer un compte +
+
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;