add cookie. add city database

This commit is contained in:
Sergei Meza 2022-10-18 16:17:20 +09:00
parent 0336f41e12
commit 55dfea1aba
5 changed files with 38 additions and 5 deletions

View file

@ -1,5 +1,5 @@
import { v4, v5 } from 'uuid';
import { startOfMonth } from 'date-fns';
import { startOfYear } from 'date-fns';
import { hash } from 'next-basics';
export function secret() {
@ -7,7 +7,7 @@ export function secret() {
}
export function salt() {
const ROTATING_SALT = hash(startOfMonth(new Date()).toUTCString());
const ROTATING_SALT = hash(startOfYear(new Date()).toUTCString());
return hash([secret(), ROTATING_SALT]);
}