Merge pull request #1808 from umami-software/bug/um-191-fix-redis-auth-misc-bug

Bug/um 191 fix redis auth misc bug
This commit is contained in:
Mike Cao 2023-03-03 13:15:10 -08:00 committed by GitHub
commit 19662abcd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 3 deletions

View File

@ -47,7 +47,7 @@ export default async (
return ok(res, { token, user }); return ok(res, { token, user });
} }
const token = createSecureToken(user.id, secret()); const token = createSecureToken({ userId: user.id }, secret());
return ok(res, { token, user }); return ok(res, { token, user });
} }

View File

@ -53,7 +53,24 @@ async function relationalQuery(data: {
}); });
} }
async function clickhouseQuery(data) { async function clickhouseQuery(data: {
id: string;
websiteId: string;
url: string;
referrer?: string;
pageTitle?: string;
eventName?: string;
hostname?: string;
browser?: string;
os?: string;
device?: string;
screen?: string;
language?: string;
country?: string;
subdivision1?: string;
subdivision2?: string;
city?: string;
}) {
const { const {
websiteId, websiteId,
id: sessionId, id: sessionId,

View File

@ -50,7 +50,23 @@ async function relationalQuery(data: {
}); });
} }
async function clickhouseQuery(data) { async function clickhouseQuery(data: {
id: string;
websiteId: string;
url: string;
referrer?: string;
pageTitle?: string;
hostname?: string;
browser?: string;
os?: string;
device?: string;
screen?: string;
language?: string;
country?: string;
subdivision1?: string;
subdivision2?: string;
city?: string;
}) {
const { const {
websiteId, websiteId,
id: sessionId, id: sessionId,

View File

@ -72,6 +72,12 @@
let currentPageTitle = document.title; let currentPageTitle = document.title;
let cache; let cache;
if (currentRef.substring(0, 4) === 'http') {
if ((currentRef = currentRef.split('/')[2].split(':')[0] === hostname)) {
currentRef = '/' + currentRef.split('/').splice(3).join('/');
}
}
/* Collect metrics */ /* Collect metrics */
const getPayload = () => ({ const getPayload = () => ({