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

Binary file not shown.

View File

@@ -2120,3 +2120,9 @@ FAM | META SEQ | SST SEQ | RANGE
0 | 00011435 | 00011434 SST | [=======================================================================] | 3aefa6fd5cf2deb4-f42f94001fcb5351 (0 MiB, fresh) 0 | 00011435 | 00011434 SST | [=======================================================================] | 3aefa6fd5cf2deb4-f42f94001fcb5351 (0 MiB, fresh)
1 | 00011436 | 00011432 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh) 1 | 00011436 | 00011432 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh)
2 | 00011437 | 00011433 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh) 2 | 00011437 | 00011433 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh)
Time 2026-03-04T14:12:37.6626717Z
Commit 00012057 4 keys in 16ms 349µs 100ns
FAM | META SEQ | SST SEQ | RANGE
0 | 00012055 | 00012054 SST | [=======================================================================] | 3aefa6fd5cf2deb4-f42f94001fcb5351 (0 MiB, fresh)
1 | 00012056 | 00012052 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh)
2 | 00012057 | 00012053 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh)

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'; export default async function Login() {
import { useRouter } from 'next/navigation'; const session = await auth();
export default function Login() { if (session?.user) {
const router = useRouter(); redirect("/dashboard");
}
return (
<LoginPage return <LoginClient />;
onSuccess={() => router.push('/dashboard')}
onRegister={() => router.push('/signup')}
/>
);
} }

View File

@@ -1,16 +1,13 @@
'use client'; import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";
import HomeClient from "@/components/HomeClient";
import LandingPage from '@/components/LandingPage'; export default async function Home() {
import { useRouter } from 'next/navigation'; const session = await auth();
export default function Home() { if (session?.user) {
const router = useRouter(); redirect("/dashboard");
}
return (
<LandingPage return <HomeClient />;
onLogin={() => router.push('/login')}
onFeatures={() => router.push('/features')}
onPricing={() => router.push('/pricing')}
/>
);
} }

View File

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

View File

@@ -0,0 +1,16 @@
'use client';
import LandingPage from '@/components/LandingPage';
import { useRouter } from 'next/navigation';
export default function HomeClient() {
const router = useRouter();
return (
<LandingPage
onLogin={() => router.push('/login')}
onFeatures={() => router.push('/features')}
onPricing={() => router.push('/pricing')}
/>
);
}

View File

@@ -0,0 +1,15 @@
'use client';
import LoginPage from '@/components/LoginPage';
import { useRouter } from 'next/navigation';
export default function LoginClient() {
const router = useRouter();
return (
<LoginPage
onSuccess={() => router.push('/dashboard')}
onRegister={() => router.push('/signup')}
/>
);
}

View File

@@ -0,0 +1,16 @@
'use client';
import AuthPage from '@/components/AuthPage';
import { useRouter } from 'next/navigation';
export default function SignupClient() {
const router = useRouter();
return (
<AuthPage
onBack={() => router.push('/')}
onSuccess={() => router.push('/dashboard')}
initialMode="signup"
/>
);
}

View File

@@ -37,7 +37,9 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
], ],
session: { session: {
strategy: 'jwt', strategy: 'jwt',
maxAge: 30 * 24 * 60 * 60, // 30 days
}, },
secret: process.env.AUTH_SECRET || 'fallback_secret_for_development_purposes_only',
callbacks: { callbacks: {
async jwt({ token, user }) { async jwt({ token, user }) {
if (user) { if (user) {