From 42826fc7ddc68206793a94ea199945ae8aad3d76 Mon Sep 17 00:00:00 2001 From: Manus Sandbox Date: Wed, 19 Nov 2025 07:03:34 -0500 Subject: [PATCH] =?UTF-8?q?Checkpoint:=20Impl=C3=A9mentation=20de=20la=20c?= =?UTF-8?q?ohabitation=20des=20deux=20syst=C3=A8mes=20d'authentification?= =?UTF-8?q?=20(OAuth=20Manus=20et=20authentification=20locale).=20Les=20ut?= =?UTF-8?q?ilisateurs=20peuvent=20maintenant=20choisir=20entre=20:=20-=20A?= =?UTF-8?q?uthentification=20locale=20avec=20email/mot=20de=20passe=20-=20?= =?UTF-8?q?OAuth=20Manus=20pour=20les=20utilisateurs=20de=20la=20plateform?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le contexte tRPC gère automatiquement les deux types de tokens (JWT local et JWT OAuth). --- client/src/const.ts | 10 + client/src/pages/Login.tsx | 22 +- drizzle/0011_talented_toad_men.sql | 3 + drizzle/meta/0011_snapshot.json | 793 +++++++++++++++++++++++++++++ drizzle/meta/_journal.json | 7 + drizzle/schema.ts | 6 +- server/_core/context.ts | 21 +- server/db.ts | 80 +++ todo.md | 8 + 9 files changed, 940 insertions(+), 10 deletions(-) create mode 100644 drizzle/0011_talented_toad_men.sql create mode 100644 drizzle/meta/0011_snapshot.json diff --git a/client/src/const.ts b/client/src/const.ts index 414e678..97b8d8b 100644 --- a/client/src/const.ts +++ b/client/src/const.ts @@ -6,3 +6,13 @@ export const APP_LOGO = "https://placehold.co/128x128/E1E7EF/1F2937?text=App"; // Retourne l'URL de la page de connexion locale export const getLoginUrl = () => "/login"; + +// Retourne l'URL de connexion OAuth Manus +export const getOAuthLoginUrl = () => { + const appId = import.meta.env.VITE_APP_ID; + const portalUrl = import.meta.env.VITE_OAUTH_PORTAL_URL; + const currentUrl = window.location.href; + const redirectUri = `${window.location.origin}/api/oauth/callback`; + const state = btoa(currentUrl); + return `${portalUrl}?appId=${appId}&redirectUri=${encodeURIComponent(redirectUri)}&state=${encodeURIComponent(state)}&responseType=code`; +}; diff --git a/client/src/pages/Login.tsx b/client/src/pages/Login.tsx index 928cf3e..89ab129 100644 --- a/client/src/pages/Login.tsx +++ b/client/src/pages/Login.tsx @@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import { Alert, AlertDescription } from "@/components/ui/alert"; -import { APP_LOGO, APP_TITLE } from "@/const"; +import { APP_LOGO, APP_TITLE, getOAuthLoginUrl } from "@/const"; import { Loader2 } from "lucide-react"; export default function Login() { @@ -102,6 +102,26 @@ export default function Login() { Se connecter +
+
+ +
+
+ + Ou + +
+
+ + +
Pas encore de compte ?{" "}