Fixed session check logic. Closes #1340.

This commit is contained in:
Mike Cao 2022-08-11 12:11:43 -07:00
parent 2181ca4ec8
commit c0276db6e3

View File

@ -49,17 +49,17 @@ export async function getSession(req) {
country,
device,
});
if (!session) {
return null;
}
} catch (e) {
if (!e.message.includes('Unique constraint')) {
if (!e.message.toLowerCase().includes('unique constraint')) {
throw e;
}
}
}
if (!session) {
return null;
}
const { session_id } = session;
return {