From 207d668a2d3db5560817dc4acac233e4aa7e3e4d Mon Sep 17 00:00:00 2001 From: David Lyon Date: Mon, 26 Feb 2024 13:13:13 -0800 Subject: [PATCH] add debugging console.logs --- src/common/cookie.ts | 2 ++ src/features/auth/hooks.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/common/cookie.ts b/src/common/cookie.ts index 8125fe19..d91932ab 100644 --- a/src/common/cookie.ts +++ b/src/common/cookie.ts @@ -24,6 +24,8 @@ export function setCookie( SameSite?: 'Lax' | 'Strict' | 'None'; } ) { + // eslint-disable-next-line no-console + console.log('setCookie', { name, value, options }); if (!name) throw new Error('cannot set unnamed cookie'); const { expires, path, domain, secure, SameSite } = { path: '/', diff --git a/src/features/auth/hooks.ts b/src/features/auth/hooks.ts index afe30134..1e8e8267 100644 --- a/src/features/auth/hooks.ts +++ b/src/features/auth/hooks.ts @@ -49,6 +49,8 @@ export const useTokenCookie = ( // Initializes auth for states where useTryAuthFromToken does not set auth useEffect(() => { + // eslint-disable-next-line no-console + console.log({ cookieToken, isUninitialized, isFetching, isSuccess, token }); // If the cookieToken is present but it failed checks and wont be overwritten by a token in state, clear if ( cookieToken && @@ -57,6 +59,8 @@ export const useTokenCookie = ( !isSuccess && !token ) { + // eslint-disable-next-line no-console + console.log('clearing'); dispatch(setAuth(null)); clearCookieToken(); // clear backup token too, if it exists