+4
src/routes/auth.ts
+4
src/routes/auth.ts
···
32
32
33
33
if (!session) {
34
34
logger.error('[Auth] OAuth callback failed: no session returned')
35
+
c.cookie.did.remove()
35
36
return c.redirect('/?error=auth_failed')
36
37
}
37
38
···
70
71
} catch (err) {
71
72
// This catches state validation failures and other OAuth errors
72
73
logger.error('[Auth] OAuth callback error', err)
74
+
c.cookie.did.remove()
73
75
return c.redirect('/?error=auth_failed')
74
76
}
75
77
}, {
···
117
119
const auth = await authenticateRequest(client, c.cookie)
118
120
119
121
if (!auth) {
122
+
c.cookie.did.remove()
120
123
return { authenticated: false }
121
124
}
122
125
···
126
129
}
127
130
} catch (err) {
128
131
logger.error('[Auth] Status check error', err)
132
+
c.cookie.did.remove()
129
133
return { authenticated: false }
130
134
}
131
135
}, {