diff --git a/src/webapp/app/api/auth/me/route.ts b/src/webapp/app/api/auth/me/route.ts index 6e9b240a..698a3460 100644 --- a/src/webapp/app/api/auth/me/route.ts +++ b/src/webapp/app/api/auth/me/route.ts @@ -2,8 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'; import type { GetProfileResponse } from '@/api-client/ApiClient'; import { cookies } from 'next/headers'; import { isTokenExpiringSoon } from '@/lib/auth/token'; - -const ENABLE_AUTH_LOGGING = true; +import { ENABLE_AUTH_LOGGING } from '@/lib/auth/constants'; const backendUrl = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000'; diff --git a/src/webapp/hooks/useAuth.tsx b/src/webapp/hooks/useAuth.tsx index 3f28af83..99369c11 100644 --- a/src/webapp/hooks/useAuth.tsx +++ b/src/webapp/hooks/useAuth.tsx @@ -17,8 +17,7 @@ import { usePathname } from 'next/navigation'; import posthog from 'posthog-js'; import { isInternalUser, isEarlyTester } from '@/lib/userLists'; import { shouldCaptureAnalytics } from '@/features/analytics/utils'; - -const ENABLE_AUTH_LOGGING = true; +import { ENABLE_AUTH_LOGGING } from '@/lib/auth/constants'; interface AuthContextType { user: GetProfileResponse | null; diff --git a/src/webapp/lib/auth/constants.ts b/src/webapp/lib/auth/constants.ts new file mode 100644 index 00000000..07d78aa1 --- /dev/null +++ b/src/webapp/lib/auth/constants.ts @@ -0,0 +1 @@ +export const ENABLE_AUTH_LOGGING = true; diff --git a/src/webapp/lib/auth/token.ts b/src/webapp/lib/auth/token.ts index d0129318..ca015090 100644 --- a/src/webapp/lib/auth/token.ts +++ b/src/webapp/lib/auth/token.ts @@ -1,4 +1,4 @@ -const ENABLE_AUTH_LOGGING = true; +import { ENABLE_AUTH_LOGGING } from '@/lib/auth/constants'; export const isTokenExpiringSoon = ( token: string | null | undefined, diff --git a/src/webapp/services/auth/CookieAuthService.client.ts b/src/webapp/services/auth/CookieAuthService.client.ts index f11de061..8f3218da 100644 --- a/src/webapp/services/auth/CookieAuthService.client.ts +++ b/src/webapp/services/auth/CookieAuthService.client.ts @@ -1,6 +1,6 @@ const appUrl = process.env.NEXT_PUBLIC_APP_URL || 'http://127.0.0.1:4000'; -const ENABLE_AUTH_LOGGING = true; +import { ENABLE_AUTH_LOGGING } from '@/lib/auth/constants'; export class ClientCookieAuthService { // Note: With HttpOnly cookies, we cannot read tokens from document.cookie diff --git a/src/webapp/services/auth/CookieAuthService.server.ts b/src/webapp/services/auth/CookieAuthService.server.ts index 913e9a78..9b53abfb 100644 --- a/src/webapp/services/auth/CookieAuthService.server.ts +++ b/src/webapp/services/auth/CookieAuthService.server.ts @@ -1,6 +1,6 @@ import { cookies } from 'next/headers'; -const ENABLE_AUTH_LOGGING = true; +import { ENABLE_AUTH_LOGGING } from '@/lib/auth/constants'; export interface AuthTokens { accessToken: string | null;