From 4e993e0c9294e62f789ec9ff1ed93d90d0a8f775 Mon Sep 17 00:00:00 2001 From: Yee Kit Date: Tue, 9 Apr 2024 16:48:55 +0800 Subject: [PATCH] Updated route to get secure next-auth cookies --- frontend/app/api/profile/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/api/profile/route.ts b/frontend/app/api/profile/route.ts index bc70e61..f8924e8 100644 --- a/frontend/app/api/profile/route.ts +++ b/frontend/app/api/profile/route.ts @@ -5,7 +5,7 @@ export async function GET(request: NextRequest) { const { pathname, origin } = request.nextUrl; const signinPage = new URL('/sign-in', origin); // Retrieve the session token from the request cookies - const session = request.cookies.get('next-auth.session-token'); + const session = request.cookies.get('next-auth.session-token') || request.cookies.get('__Secure-next-auth.session-token'); // Create a new Supabase client const supabase = createClient(