From abe56af40f7f4454f511700890b19004a920849a Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 18 May 2023 17:31:54 +0100 Subject: [PATCH] fix: hard-coded domain name --- src/hooks/useDarkMode.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useDarkMode.ts b/src/hooks/useDarkMode.ts index d04a3e1f..c3c56f09 100644 --- a/src/hooks/useDarkMode.ts +++ b/src/hooks/useDarkMode.ts @@ -7,6 +7,7 @@ import { DEFAULT_COLOR_SCHEME, IS_DEV, } from "~/lib/constants" +import { OUR_DOMAIN } from "~/lib/env" import { noop } from "~/lib/noop" import { delStorage, getStorage, setStorage } from "~/lib/storage" import { isServerSide } from "~/lib/utils" @@ -205,7 +206,7 @@ export const useDarkMode = () => { date.setMonth(date.getMonth() + 1) document.cookie = IS_DEV ? `color_scheme=${colorScheme};` - : `color_scheme=${colorScheme}; Domain=.xlog.app; Path=/; Secure; HttpOnly; expires=${date.toUTCString()}` + : `color_scheme=${colorScheme}; Domain=.${OUR_DOMAIN}; Path=/; Secure; HttpOnly; expires=${date.toUTCString()}` }, [value]) const onceRef = useRef(false)