mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Added id as a parameter to identify and include it in the payload. Removed the usage of localstorage
This commit is contained in:
parent
224961447c
commit
37ae0374d8
2 changed files with 13 additions and 23 deletions
|
|
@ -18,7 +18,7 @@ const schema = z.object({
|
|||
payload: z.object({
|
||||
website: z.string().uuid(),
|
||||
data: anyObjectParam.optional(),
|
||||
identity: anyObjectParam.optional(),
|
||||
id: z.string().optional(),
|
||||
hostname: z.string().max(100).optional(),
|
||||
language: z.string().max(35).optional(),
|
||||
referrer: urlOrPathParam.optional(),
|
||||
|
|
@ -60,7 +60,7 @@ export async function POST(request: Request) {
|
|||
title,
|
||||
tag,
|
||||
timestamp,
|
||||
identity,
|
||||
id,
|
||||
} = payload;
|
||||
|
||||
// Cache check
|
||||
|
|
@ -99,13 +99,7 @@ export async function POST(request: Request) {
|
|||
const sessionSalt = hash(startOfMonth(createdAt).toUTCString());
|
||||
const visitSalt = hash(startOfHour(createdAt).toUTCString());
|
||||
|
||||
const sessionId = uuid(
|
||||
websiteId,
|
||||
ip,
|
||||
userAgent,
|
||||
sessionSalt,
|
||||
identity ? JSON.stringify(identity) : '',
|
||||
);
|
||||
const sessionId = uuid(websiteId, ip, userAgent, sessionSalt, id ? id : '');
|
||||
|
||||
// Find session
|
||||
if (!clickhouse.enabled && !cache?.sessionId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue