From 85eedb1906afdaa626e66f9e4abca243a9c22297 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Mon, 6 Jan 2025 20:41:29 -0500 Subject: [PATCH] Fix error on logout --- src/app/utils/auth.ts | 8 ++++++++ src/app/utils/server/auth.ts | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/utils/auth.ts b/src/app/utils/auth.ts index 2b207cdc..b3c94ec2 100644 --- a/src/app/utils/auth.ts +++ b/src/app/utils/auth.ts @@ -26,6 +26,14 @@ export async function getSession(): Promise { } } +export async function deleteSession() { + const cookieKeys = + 'academy-completed ships signpost-feed tickets verification waka' + .split(' ') + .forEach((key) => cookies().delete(key)) + cookies().delete(sessionCookieName) +} + export async function createMagicSession(magicCode: string) { try { const partialPersonData = await getPersonByMagicToken(magicCode) diff --git a/src/app/utils/server/auth.ts b/src/app/utils/server/auth.ts index 82c14c96..2a49ff0e 100644 --- a/src/app/utils/server/auth.ts +++ b/src/app/utils/server/auth.ts @@ -86,14 +86,6 @@ export async function verifySession( } } -export async function deleteSession() { - const cookieKeys = - 'academy-completed ships signpost-feed tickets verification waka' - .split(' ') - .forEach((key) => cookies().delete(key)) - cookies().delete(sessionCookieName) -} - export async function signAndSet(session: HsSession) { session.sig = await hashSession(session)