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.

Fix website get during collection/session check

Brian Cao42bdfccdf450
diff --git a/lib/redis.js b/lib/redis.js
index 24d814381..92c8bdb9e 100644
--- a/lib/redis.js
+++ b/lib/redis.js
@@ -19,6 +19,8 @@ function getClient() {
global[REDIS] = redis;
}
+ log('Redis initialized');
+
return redis;
}
diff --git a/lib/session.js b/lib/session.js
index b01cbe9a0..1b79f316a 100644
--- a/lib/session.js
+++ b/lib/session.js
@@ -37,8 +37,8 @@ export async function getSession(req) {
// Check database if redis does not have
if (!websiteId) {
- const { website_id } = await getWebsiteByUuid(website_uuid);
- websiteId = website_id;
+ const website = await getWebsiteByUuid(website_uuid);
+ websiteId = website ? website.website_id : null;
}
if (!websiteId || websiteId === DELETED) {