This commit is contained in:
Omer Sabic 2024-06-07 14:35:02 +02:00
parent 54ed89cdd8
commit 096b4f64d4

View File

@ -14,6 +14,8 @@ export async function createSession(user_id, {
refresh_token,
expires_at,
}) {
try {
const [existing_session] = await db.select().from(sessions).where(eq(sessions.user_id, user_id));
if (existing_session) {
@ -35,4 +37,9 @@ export async function createSession(user_id, {
return {
session_id: token[0].id
}
} catch (e) {
console.log(e);
throw e;
}
}