"use client"; import { useState } from "react"; import { signIn } from "next-auth/react"; import { useTranslations } from "next-intl"; import Link from "next/link"; import { useParams } from "next/navigation"; export default function LoginPage() { const t = useTranslations("auth"); const params = useParams(); const locale = params.locale as string; const [email, setEmail] = useState(""); const [loading, setLoading] = useState(false); const [error, setError] = useState(""); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!email) return; setLoading(true); setError(""); try { await signIn("resend", { email, redirectTo: `/${locale}/auth/verify`, }); } catch { setError("Une erreur est survenue."); setLoading(false); } }; return (
{/* Logo */}
🦉

OwlCub Academy

{t("login_title")}

{/* Form card */}
setEmail(e.target.value)} placeholder={t("email_placeholder")} required autoFocus style={{ fontSize: 15 }} />
{error && (

{error}

)}

Nous vous enverrons un lien de connexion sécurisé par email. Aucun mot de passe requis.

← Retour aux formations
); }