Checkpoint: v9c : Correction déploiement VPS - migration DB (colonnes login/firstName/lastName/isActive), correction JWT name vide, protection OAuth Invalid URL, seed-admin avec openId automatique
This commit is contained in:
BIN
client/public/logoFEHAP.PNG
Normal file
BIN
client/public/logoFEHAP.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -4,6 +4,10 @@ export { COOKIE_NAME, ONE_YEAR_MS } from "@shared/const";
|
||||
export const getLoginUrl = () => {
|
||||
const oauthPortalUrl = import.meta.env.VITE_OAUTH_PORTAL_URL;
|
||||
const appId = import.meta.env.VITE_APP_ID;
|
||||
|
||||
// Si OAUTH_PORTAL_URL n'est pas configuré (déploiement sans OAuth Manus), retourner chaîne vide
|
||||
if (!oauthPortalUrl) return "";
|
||||
|
||||
const redirectUri = `${window.location.origin}/api/oauth/callback`;
|
||||
const state = btoa(redirectUri);
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@ import { getLoginUrl } from "@/const";
|
||||
import { useLocation } from "wouter";
|
||||
import { KeyRound, ExternalLink } from "lucide-react";
|
||||
|
||||
const FEHAP_LOGO = "/manus-storage/logoFEHAP_69ddd0ee.PNG";
|
||||
const FEHAP_LOGO = "/logoFEHAP.PNG";
|
||||
const SANTINOVA_LOGO_TEXT = "Santinova Soft";
|
||||
|
||||
export default function Login() {
|
||||
const [, navigate] = useLocation();
|
||||
const loginUrl = getLoginUrl();
|
||||
const oauthEnabled = !!loginUrl;
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex bg-background">
|
||||
@@ -78,29 +80,33 @@ export default function Login() {
|
||||
</p>
|
||||
|
||||
<div className="space-y-4">
|
||||
{/* Connexion via espace adhérent FEHAP */}
|
||||
<a
|
||||
href={getLoginUrl()}
|
||||
className="group flex items-center gap-4 p-5 bg-primary text-white rounded-2xl shadow-md hover:bg-primary/90 transition-all hover:shadow-lg hover:-translate-y-0.5"
|
||||
>
|
||||
<div className="w-10 h-10 rounded-xl bg-white/20 flex items-center justify-center flex-shrink-0">
|
||||
<ExternalLink size={20} className="text-white" />
|
||||
</div>
|
||||
<div className="flex-1 text-left">
|
||||
<div className="font-semibold text-base">Espace adhérent FEHAP</div>
|
||||
<div className="text-sm text-white/75 mt-0.5">
|
||||
Connexion via votre compte FEHAP existant
|
||||
{/* Connexion via espace adhérent FEHAP — masqué si OAuth non configuré */}
|
||||
{oauthEnabled && (
|
||||
<a
|
||||
href={loginUrl}
|
||||
className="group flex items-center gap-4 p-5 bg-primary text-white rounded-2xl shadow-md hover:bg-primary/90 transition-all hover:shadow-lg hover:-translate-y-0.5"
|
||||
>
|
||||
<div className="w-10 h-10 rounded-xl bg-white/20 flex items-center justify-center flex-shrink-0">
|
||||
<ExternalLink size={20} className="text-white" />
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-white/50 group-hover:text-white/80 transition-colors text-lg">→</span>
|
||||
</a>
|
||||
<div className="flex-1 text-left">
|
||||
<div className="font-semibold text-base">Espace adhérent FEHAP</div>
|
||||
<div className="text-sm text-white/75 mt-0.5">
|
||||
Connexion via votre compte FEHAP existant
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-white/50 group-hover:text-white/80 transition-colors text-lg">→</span>
|
||||
</a>
|
||||
)}
|
||||
|
||||
{/* Séparateur */}
|
||||
<div className="flex items-center gap-3 py-1">
|
||||
<div className="flex-1 h-px bg-border" />
|
||||
<span className="text-xs text-muted-foreground font-medium">ou</span>
|
||||
<div className="flex-1 h-px bg-border" />
|
||||
</div>
|
||||
{/* Séparateur — affiché seulement si OAuth activé */}
|
||||
{oauthEnabled && (
|
||||
<div className="flex items-center gap-3 py-1">
|
||||
<div className="flex-1 h-px bg-border" />
|
||||
<span className="text-xs text-muted-foreground font-medium">ou</span>
|
||||
<div className="flex-1 h-px bg-border" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Connexion locale */}
|
||||
<button
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useLocation } from "wouter";
|
||||
import { toast } from "sonner";
|
||||
import { Eye, EyeOff, Lock, User, ArrowLeft, ExternalLink } from "lucide-react";
|
||||
|
||||
const FEHAP_LOGO = "/manus-storage/logoFEHAP_69ddd0ee.PNG";
|
||||
const FEHAP_LOGO = "/logoFEHAP.PNG";
|
||||
const SANTINOVA_LOGO_TEXT = "Santinova Soft";
|
||||
|
||||
export default function LoginLocal() {
|
||||
|
||||
Reference in New Issue
Block a user