Skip to content

Commit

Permalink
return session
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Aug 25, 2023
1 parent 6c233d5 commit a8aa45c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,9 @@ export const authOptions: NextAuthOptions = {
});

if (!user) {
// If the user does not exist, return null to log them out
return null;
// If the user does not exist, set user to null
return { ...session, user: null };
}

session.user = { ...token } as IUser;
return session;
},
Expand Down

0 comments on commit a8aa45c

Please sign in to comment.