diff --git a/lib/src/authentication.ts b/lib/src/authentication.ts index 0903adf4..983712de 100644 --- a/lib/src/authentication.ts +++ b/lib/src/authentication.ts @@ -103,7 +103,9 @@ export const setCookieAuthentication = (store: Store, agent: Agent) => { }; export const removeCookieAuthentication = () => { - document.cookie = `${COOKIE_NAME_AUTH}=;Max-Age=-99999999`; + if (typeof document !== 'undefined') { + document.cookie = `${COOKIE_NAME_AUTH}=;Max-Age=-99999999`; + } }; /** Returns false if the auth cookie is not set / expired */