Skip to content

Commit c422143

Browse files
msukkariclaude
andcommitted
chore: hoist token.sessionVersion ?? 0 into a named local
Slightly easier to read the cross-check condition when the JWT-side value isn't sharing a line with the && and the inequality. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent de019df commit c422143

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/web/src/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ const nextAuthResult = NextAuth({
303303
// invalidated since the JWT was minted. Returning null here
304304
// is what makes invalidation visible at /api/auth/session,
305305
// not just at withAuth-gated endpoints.
306-
if (!user && (token.sessionVersion ?? 0) !== dbUser.sessionVersion) {
306+
const tokenSessionVersion = token.sessionVersion ?? 0;
307+
if (!user && tokenSessionVersion !== dbUser.sessionVersion) {
307308
return null;
308309
}
309310

0 commit comments

Comments
 (0)