diff --git a/apps/web/.env b/apps/web/.env index 90475f97a6e4063ebd963eb4c32a408a82e52d84..0c5463cd0120d392bb08e3e84eadf6696c60b20e 100644 --- a/apps/web/.env +++ b/apps/web/.env @@ -1,8 +1,8 @@ +GRAPHPOLARIS_VERSION=dev BACKEND_URL=http://localhost BACKEND_WSS_URL=ws://localhost:3001/ STAGING=dev -SKIP_LOGIN=true BACKEND_USER=:3000 BACKEND_QUERY=:3003 BACKEND_SCHEMA=:3002 -GRAPHPOLARIS_VERSION=dev \ No newline at end of file +GRAPHPOLARIS_VERSION=dev diff --git a/apps/web/.env.example b/apps/web/.env.example index 9c4a604ee7ecd86e9a4e23470c8e99289610eb7b..976455964d3ae0918f6c33be54929e7b9794abf7 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -2,7 +2,6 @@ GRAPHPOLARIS_VERSION= BACKEND_URL= BACKEND_WSS_URL= STAGING= -SKIP_LOGIN= BACKEND_USER= BACKEND_QUERY= BACKEND_SCHEMA= \ No newline at end of file diff --git a/libs/shared/lib/data-access/authorization/useAuth.tsx b/libs/shared/lib/data-access/authorization/useAuth.tsx index 2983c0b31630c721b158b9fa7f31c7d7a5e2ca58..ee33f3caf1500c87df1cdc43b32d2a1dabde959a 100644 --- a/libs/shared/lib/data-access/authorization/useAuth.tsx +++ b/libs/shared/lib/data-access/authorization/useAuth.tsx @@ -24,8 +24,8 @@ export const useAuth = () => { const auth = useAuthorizationCache(); const handleError = (err: any) => { - if (import.meta.env.SKIP_LOGIN) { - console.warn('skipping login'); + if (domain.includes('localhost')) { + console.warn('skipping login for localhost'); dispatch( authorized({ username: 'UserID', @@ -63,7 +63,8 @@ export const useAuth = () => { const fetchAuthenticated = (input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response> => { if (!init) init = fetchSettings; - if (!import.meta.env.SKIP_LOGIN) { + if (!domain.includes('localhost')) { + // Production logic init.credentials = 'include'; init.redirect = 'follow'; init.method = init.method || 'GET';