mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
update visitId hash and expiration logic
This commit is contained in:
parent
d3ca856521
commit
0aaf2c0b3b
5 changed files with 44 additions and 10 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { startOfMonth } from 'date-fns';
|
||||
import { startOfHour, startOfMonth } from 'date-fns';
|
||||
import { hash } from 'next-basics';
|
||||
import { v4, v5, validate } from 'uuid';
|
||||
|
||||
|
|
@ -12,6 +12,12 @@ export function salt() {
|
|||
return hash(secret(), ROTATING_SALT);
|
||||
}
|
||||
|
||||
export function sessionSalt() {
|
||||
const ROTATING_SALT = hash(startOfHour(new Date()).toUTCString());
|
||||
|
||||
return hash(secret(), ROTATING_SALT);
|
||||
}
|
||||
|
||||
export function uuid(...args: any) {
|
||||
if (!args.length) return v4();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue