This commit is contained in:
2025-12-04 15:49:57 +01:00
parent c698a0b893
commit 60a3c82cd9
26 changed files with 399 additions and 98 deletions

View File

@@ -3,7 +3,6 @@ import { NextResponse } from 'next/server';
import { getAuthService } from '../../../../lib/auth';
const SESSION_COOKIE = 'gp_demo_session';
const STATE_COOKIE = 'gp_demo_auth_state';
export async function GET(request: Request) {
@@ -24,14 +23,7 @@ export async function GET(request: Request) {
}
const authService = getAuthService();
const session = await authService.loginWithIracingCallback({ code, state, returnTo });
cookieStore.set(SESSION_COOKIE, JSON.stringify(session), {
httpOnly: true,
sameSite: 'lax',
path: '/',
secure: process.env.NODE_ENV === 'production',
});
await authService.loginWithIracingCallback({ code, state, returnTo });
cookieStore.delete(STATE_COOKIE);