fix: parse cookie domain (#185)

* chore: update bots and referrers

* fix: handle cookie domain better
This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-04 21:22:09 +02:00
committed by GitHub
parent 0b4fcbad69
commit 280065c2c4
3 changed files with 527 additions and 8 deletions

View File

@@ -1,11 +1,4 @@
// Sorry co.uk, but you're not a top domain
const parseCookieDomain = (url: string) => {
const domain = new URL(url);
return {
domain: domain.hostname.split('.').slice(-2).join('.'),
secure: domain.protocol === 'https:',
};
};
import { parseCookieDomain } from './parse-cookie-domain';
const parsed = parseCookieDomain(process.env.NEXT_PUBLIC_DASHBOARD_URL ?? '');