mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
12 lines
313 B
JavaScript
12 lines
313 B
JavaScript
import { startOfMonth } from 'date-fns';
|
|
import { hash } from 'next-basics';
|
|
|
|
export function secret() {
|
|
return hash(process.env.APP_SECRET || process.env.DATABASE_URL);
|
|
}
|
|
|
|
export function salt() {
|
|
const ROTATING_SALT = hash(startOfMonth(new Date()).toUTCString());
|
|
|
|
return hash(secret(), ROTATING_SALT);
|
|
}
|