v9b: correction OAuth Invalid URL + logo FEHAP public
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ 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,9 +80,10 @@ export default function Login() {
|
||||
</p>
|
||||
|
||||
<div className="space-y-4">
|
||||
{/* Connexion via espace adhérent FEHAP */}
|
||||
{/* Connexion via espace adhérent FEHAP — masqué si OAuth non configuré */}
|
||||
{oauthEnabled && (
|
||||
<a
|
||||
href={getLoginUrl()}
|
||||
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">
|
||||
@@ -94,13 +97,16 @@ export default function Login() {
|
||||
</div>
|
||||
<span className="text-white/50 group-hover:text-white/80 transition-colors text-lg">→</span>
|
||||
</a>
|
||||
)}
|
||||
|
||||
{/* Séparateur */}
|
||||
{/* 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
|
||||
|
||||
Reference in New Issue
Block a user