Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed session check logic. Closes #1340.

Mike Caoc0276db6e3f2
diff --git a/lib/session.js b/lib/session.js
index 7c4476d6f..c9fb04d7d 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 {