Merged in fix/document-undefined (pull request #3118)

Fix/document undefined

* fix: check if document is undefined

* fix: check if document is undefined


Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-11-11 07:21:29 +00:00
parent c93e2b6f0b
commit 0490badbb1
2 changed files with 6 additions and 2 deletions

View File

@@ -23,7 +23,9 @@ export const useTrackHardNavigationBasic = ({
const sessionId = useSessionId()
const { data: session } = useSession()
const validSession = isValidSession(session)
const hasWebviewToken = global?.document?.cookie?.includes("webviewToken=")
const hasWebviewToken =
typeof document !== "undefined" &&
document?.cookie?.includes("webviewToken=")
const isUserLoggedIn = validSession || !!hasWebviewToken