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 ?{" "}