Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Brian Cao 2023-03-03 13:15:19 -08:00
commit 05f01cd09e
4 changed files with 42 additions and 3 deletions

View File

@ -47,7 +47,7 @@ export default async (
return ok(res, { token, user });
}
const token = createSecureToken(user.id, secret());
const token = createSecureToken({ userId: user.id }, secret());
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 {
websiteId,
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 {
websiteId,
id: sessionId,

View File

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