We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c61ed31 commit 0571809Copy full SHA for 0571809
web/src/app/api/auth/cli/logout/route.ts
@@ -36,13 +36,14 @@ export async function POST(req: Request) {
36
id: schema.session.sessionToken,
37
})
38
39
+ // If no session was deleted, it means the token was already invalid or the user was already logged out.
40
+ // This is effectively a no-op, so we treat it as a successful logout rather than an error.
41
if (validDeletion.length === 0) {
- return NextResponse.json(
- {
42
- error: INVALID_AUTH_TOKEN_MESSAGE,
43
- },
44
- { status: 401 }
+ logger.info(
+ { fingerprintId },
+ 'Logout attempted with invalid/expired token - treating as successful no-op'
45
)
46
+ return NextResponse.json({ success: true })
47
}
48
49
// Then reset sig_hash to null
0 commit comments