diff --git a/lib/session.js b/lib/session.js index 7c4476d6..c9fb04d7 100644 --- a/lib/session.js +++ b/lib/session.js @@ -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 {