Skip to content

Commit

Permalink
fix: don't create a session if user is not enabled (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-dalmet authored Sep 9, 2024
1 parent e256bd7 commit 241ef7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/config/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export const getServerAuthSession = cache(async () => {

const { user, session } = await lucia.validateSession(sessionId);

if (user?.accountStatus !== 'ENABLED')
return {
user: null,
session: null,
};

try {
if (session?.fresh) {
const sessionCookie = lucia.createSessionCookie(session.id);
Expand Down

0 comments on commit 241ef7e

Please sign in to comment.