groups api route
This commit is contained in:
@@ -12,7 +12,10 @@ export async function createSession(user_id: string) {
|
||||
}
|
||||
|
||||
export async function validateSession(session_id: string) {
|
||||
const session = await db.select().from(sessionsTable).where(eq(sessionsTable.id, session_id)).leftJoin(usersTable, eq(usersTable.id, sessionsTable.user_id));
|
||||
|
||||
return session[0].users;
|
||||
try {
|
||||
const session = await db.select().from(sessionsTable).where(eq(sessionsTable.id, session_id)).leftJoin(usersTable, eq(usersTable.id, sessionsTable.user_id));
|
||||
return session[0].users;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user