feat: delete session when user is not found
This commit is contained in:
@@ -29,7 +29,10 @@ export async function getSession(
|
||||
if (session === null) return null;
|
||||
|
||||
const user = await userModel.findById(session.user);
|
||||
if (user === null) return null;
|
||||
if (user === null) {
|
||||
await deleteSession(sessionId);
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
sid: session.id,
|
||||
|
||||
Reference in New Issue
Block a user