correction du token lors du login

This commit is contained in:
2026-03-04 15:12:47 +01:00
parent a03675ed7f
commit c8fffece3e
9 changed files with 82 additions and 35 deletions

View File

@@ -1,15 +1,13 @@
'use client';
import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";
import LoginClient from "@/components/LoginClient";
import LoginPage from '@/components/LoginPage';
import { useRouter } from 'next/navigation';
export default async function Login() {
const session = await auth();
export default function Login() {
const router = useRouter();
if (session?.user) {
redirect("/dashboard");
}
return (
<LoginPage
onSuccess={() => router.push('/dashboard')}
onRegister={() => router.push('/signup')}
/>
);
return <LoginClient />;
}