From 83b32f44aba65b0322564148481f4af216c56fcb Mon Sep 17 00:00:00 2001 From: Manus Sandbox Date: Sun, 23 Nov 2025 05:45:41 -0500 Subject: [PATCH] =?UTF-8?q?Checkpoint:=20Ajout=20d'une=20page=20de=20choix?= =?UTF-8?q?=20de=20connexion=20=C3=A0=20la=20racine=20(/)=20permettant=20d?= =?UTF-8?q?e=20s=C3=A9lectionner=20entre=20"Connexion=20Manus=20OAuth"=20e?= =?UTF-8?q?t=20"Connexion=20locale".=20La=20page=20affiche=20deux=20cartes?= =?UTF-8?q?=20avec=20ic=C3=B4nes=20distinctes=20(bouclier=20bleu=20pour=20?= =?UTF-8?q?OAuth,=20cl=C3=A9=20verte=20pour=20connexion=20locale)=20et=20r?= =?UTF-8?q?edirige=20vers=20la=20page=20appropri=C3=A9e=20selon=20le=20cho?= =?UTF-8?q?ix=20de=20l'utilisateur.=20Cette=20page=20r=C3=A9sout=20le=20pr?= =?UTF-8?q?obl=C3=A8me=20de=20redirection=20automatique=20vers=20OAuth=20e?= =?UTF-8?q?n=20production=20en=20offrant=20un=20point=20d'entr=C3=A9e=20cl?= =?UTF-8?q?air=20pour=20les=20deux=20modes=20d'authentification.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 4 +- client/src/pages/LoginChoice.tsx | 92 ++++++++++++++++++++++++++++++++ todo.md | 18 +++++++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 client/src/pages/LoginChoice.tsx diff --git a/client/src/App.tsx b/client/src/App.tsx index 2dcde33..f3871a2 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -5,6 +5,7 @@ import { Route, Switch } from "wouter"; import ErrorBoundary from "./components/ErrorBoundary"; import { ThemeProvider } from "./contexts/ThemeContext"; import Home from "./pages/Home"; +import LoginChoice from "./pages/LoginChoice"; import AdminRapportPublicCible from "./pages/AdminRapportPublicCible"; import Admin from "./pages/Admin"; import AdminFormations from "./pages/AdminFormations"; @@ -23,7 +24,8 @@ import Login from "./pages/Login"; function Router() { return ( - + + diff --git a/client/src/pages/LoginChoice.tsx b/client/src/pages/LoginChoice.tsx new file mode 100644 index 0000000..d4948c4 --- /dev/null +++ b/client/src/pages/LoginChoice.tsx @@ -0,0 +1,92 @@ +import { useLocation } from "wouter"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { APP_LOGO, APP_TITLE, getLoginUrl } from "@/const"; +import { KeyRound, Shield } from "lucide-react"; + +export default function LoginChoice() { + const [, setLocation] = useLocation(); + + const handleManusLogin = () => { + window.location.href = getLoginUrl(); + }; + + const handleLocalLogin = () => { + setLocation("/login"); + }; + + return ( +
+ + +
+ Logo +
+
+ {APP_TITLE} + + Choisissez votre méthode de connexion + +
+
+ +
+ {/* Connexion Manus OAuth */} + + +
+
+ +
+
+ Connexion Manus + + Utilisez votre compte Manus (Google, Microsoft, Apple) + +
+ + + +
+ + {/* Connexion Locale */} + + +
+
+ +
+
+ Connexion Locale + + Utilisez votre identifiant et mot de passe + +
+ + + +
+
+ +
+

Vous n'avez pas de compte ?

+

Contactez l'administrateur

+
+
+
+
+ ); +} diff --git a/todo.md b/todo.md index 0ce685e..2ab87b4 100644 --- a/todo.md +++ b/todo.md @@ -424,3 +424,21 @@ - [x] Identifier pourquoi /login redirige vers OAuth au lieu d'afficher le formulaire local - [x] Corriger la page Login.tsx pour empêcher la redirection automatique - [x] Tester que /login affiche bien le formulaire username/password + +## Désactiver la redirection OAuth pour /login + +- [ ] Identifier le middleware qui force la redirection vers OAuth +- [ ] Exclure la route /login de la redirection automatique +- [ ] Tester que /login affiche bien le formulaire local même après publication + +## Créer une page de choix de connexion + +- [ ] Créer une page LoginChoice avec boutons "Connexion Manus" et "Connexion locale" +- [ ] Modifier les routes pour afficher cette page en premier +- [ ] Tester le choix et les redirections + +## Créer une page de choix de connexion + +- [x] Créer une page LoginChoice avec boutons "Connexion Manus" et "Connexion locale" +- [x] Modifier les routes pour afficher cette page en premier +- [x] Tester le choix et les redirections