This commit is contained in:
Manus Sandbox
2025-11-19 08:34:55 -05:00
parent 4d2ed3d5d8
commit 1313a45879
10 changed files with 11 additions and 962 deletions

View File

@@ -6,14 +6,3 @@ 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;
// Toujours rediriger vers /admin après OAuth
const redirectAfterAuth = `${window.location.origin}/admin`;
const redirectUri = `${window.location.origin}/api/oauth/callback`;
const state = btoa(redirectAfterAuth);
return `${portalUrl}?appId=${appId}&redirectUri=${encodeURIComponent(redirectUri)}&state=${encodeURIComponent(state)}&responseType=code`;
};

View File

@@ -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, getOAuthLoginUrl } from "@/const";
import { APP_LOGO, APP_TITLE } from "@/const";
import { Loader2 } from "lucide-react";
export default function Login() {
@@ -102,26 +102,6 @@ export default function Login() {
Se connecter
</Button>
<div className="relative">
<div className="absolute inset-0 flex items-center">
<span className="w-full border-t" />
</div>
<div className="relative flex justify-center text-xs uppercase">
<span className="bg-background px-2 text-muted-foreground">
Ou
</span>
</div>
</div>
<Button
type="button"
variant="outline"
className="w-full"
onClick={() => window.location.href = getOAuthLoginUrl()}
>
Se connecter avec Manus OAuth
</Button>
<div className="text-sm text-center text-muted-foreground">
Pas encore de compte ?{" "}
<button