WTF!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! same iss
This commit is contained in:
+7
-2
@@ -1,3 +1,4 @@
|
||||
|
||||
'use server';
|
||||
|
||||
import { redirect } from 'next/navigation';
|
||||
@@ -54,14 +55,18 @@ export async function signOut() {
|
||||
}
|
||||
|
||||
export async function getSession() {
|
||||
const sessionCookie = cookies().get('session');
|
||||
const cookieStore = cookies();
|
||||
const sessionCookie = cookieStore.get('session');
|
||||
|
||||
if (!sessionCookie) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return JSON.parse(sessionCookie.value);
|
||||
const session = JSON.parse(sessionCookie.value);
|
||||
return session;
|
||||
} catch (error) {
|
||||
console.error('Failed to parse session cookie:', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user