"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 (
{t("login_title")}
Nous vous enverrons un lien de connexion sécurisé par email. Aucun mot de passe requis.