mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 13:17:19 +01:00
include visitors metrics in websiteStats
This commit is contained in:
parent
1a839d1cae
commit
51139c1918
4 changed files with 31 additions and 20 deletions
|
|
@ -12,7 +12,7 @@ export function salt() {
|
|||
return hash(secret(), ROTATING_SALT);
|
||||
}
|
||||
|
||||
export function sessionSalt() {
|
||||
export function visitSalt() {
|
||||
const ROTATING_SALT = hash(startOfHour(new Date()).toUTCString());
|
||||
|
||||
return hash(secret(), ROTATING_SALT);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { isUuid, secret, sessionSalt, uuid } from 'lib/crypto';
|
||||
import { isUuid, secret, uuid, visitSalt } from 'lib/crypto';
|
||||
import { getClientInfo } from 'lib/detect';
|
||||
import { parseToken } from 'next-basics';
|
||||
import { NextApiRequestCollect } from 'pages/api/send';
|
||||
|
|
@ -68,7 +68,7 @@ export async function findSession(req: NextApiRequestCollect): Promise<{
|
|||
await getClientInfo(req, payload);
|
||||
|
||||
const sessionId = uuid(websiteId, hostname, ip, userAgent);
|
||||
const visitId = uuid(sessionId, sessionSalt());
|
||||
const visitId = uuid(sessionId, visitSalt());
|
||||
|
||||
// Clickhouse does not require session lookup
|
||||
if (clickhouse.enabled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue