mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 13:17:19 +01:00
Merge pull request #3334 from perso182/props-in-session-definition
Use the props passed to identify to determine sessions
This commit is contained in:
commit
0fd2d09dba
2 changed files with 14 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ const schema = z.object({
|
|||
payload: z.object({
|
||||
website: z.string().uuid(),
|
||||
data: anyObjectParam.optional(),
|
||||
id: z.string().optional(),
|
||||
hostname: z.string().max(100).optional(),
|
||||
language: z.string().max(35).optional(),
|
||||
referrer: urlOrPathParam.optional(),
|
||||
|
|
@ -54,6 +55,7 @@ export async function POST(request: Request) {
|
|||
title,
|
||||
tag,
|
||||
timestamp,
|
||||
id,
|
||||
} = payload;
|
||||
|
||||
// Cache check
|
||||
|
|
@ -97,7 +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);
|
||||
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