From 13cfcbbb8726fcec6c161f046120016bc32cbea6 Mon Sep 17 00:00:00 2001 From: "@nekomimi.pet" Date: Tue, 11 Nov 2025 04:48:19 -0500 Subject: [PATCH] clear --- src/routes/auth.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/auth.ts b/src/routes/auth.ts index b982ffc..c4e9baf 100644 --- a/src/routes/auth.ts +++ b/src/routes/auth.ts @@ -32,6 +32,7 @@ export const authRoutes = (client: NodeOAuthClient, cookieSecret: string) => new if (!session) { logger.error('[Auth] OAuth callback failed: no session returned') + c.cookie.did.remove() return c.redirect('/?error=auth_failed') } @@ -70,6 +71,7 @@ export const authRoutes = (client: NodeOAuthClient, cookieSecret: string) => new } catch (err) { // This catches state validation failures and other OAuth errors logger.error('[Auth] OAuth callback error', err) + c.cookie.did.remove() return c.redirect('/?error=auth_failed') } }, { @@ -117,6 +119,7 @@ export const authRoutes = (client: NodeOAuthClient, cookieSecret: string) => new const auth = await authenticateRequest(client, c.cookie) if (!auth) { + c.cookie.did.remove() return { authenticated: false } } @@ -126,6 +129,7 @@ export const authRoutes = (client: NodeOAuthClient, cookieSecret: string) => new } } catch (err) { logger.error('[Auth] Status check error', err) + c.cookie.did.remove() return { authenticated: false } } }, { -- 2.54.0