From 948651b39843fdb1a8d08ec85bd827967ed83f30 Mon Sep 17 00:00:00 2001 From: Omer Sabic Date: Fri, 7 Jun 2024 15:10:51 +0200 Subject: [PATCH] af --- src/routes/auth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/auth.js b/src/routes/auth.js index f2f3919..862ba58 100644 --- a/src/routes/auth.js +++ b/src/routes/auth.js @@ -63,7 +63,8 @@ export const authRoutes = (fastify, _, done) => { } } let session_id; - if (token.refresh_token) { + let existing_session = await tx.select().from(sessions).where(eq(sessions.user_id, user.id)); + if (existing_session.length > 0) { let session_info = await createSession(user.id, { access_token: token.access_token, refresh_token: token.refresh_token,