Skip to content

Commit e18c045

Browse files
committed
fix(auth): resolve JWT session error after login
1 parent dd2efea commit e18c045

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

apps/web/auth.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
4747
// Verify password using secure hash comparison
4848
if (verifyPassword(password, currentUser.password)) {
4949
return {
50-
// id: "1", // Static ID for single user app
50+
id: "1", // Static ID for single user app
5151
name: currentUser.username,
5252
}
5353
}
@@ -67,7 +67,8 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
6767
},
6868
callbacks: {
6969
async jwt({ token, user }) {
70-
if (user.id) {
70+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- user is undefined on subsequent JWT callback invocations
71+
if (user) {
7172
token.id = user.id
7273
}
7374
return token

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web",
3-
"version": "0.12.0",
3+
"version": "0.12.1",
44
"private": true,
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)