Fix website get during collection/session check

This commit is contained in:
Brian Cao 2022-09-05 11:36:57 -07:00
parent 44e017c14a
commit 42bdfccdf4
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,8 @@ function getClient() {
global[REDIS] = redis;
}
log('Redis initialized');
return redis;
}

View File

@ -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) {