From 10461be125ba5972a37d6a788befe58d81f3bafb Mon Sep 17 00:00:00 2001 From: nsemets Date: Tue, 12 Aug 2025 18:56:11 +0300 Subject: [PATCH] fix(cookies): get staging cookie --- src/app/core/interceptors/auth.interceptor.ts | 2 -- src/app/features/auth/services/auth.service.ts | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/core/interceptors/auth.interceptor.ts b/src/app/core/interceptors/auth.interceptor.ts index c1e36212c..c70348470 100644 --- a/src/app/core/interceptors/auth.interceptor.ts +++ b/src/app/core/interceptors/auth.interceptor.ts @@ -12,8 +12,6 @@ export const authInterceptor: HttpInterceptorFn = ( const cookieService = inject(CookieService); const csrfToken = cookieService.get('api-csrf'); - const staging = cookieService.get('osf_staging4'); - console.log(staging); if (!req.url.includes('/api.crossref.org/funders')) { const headers: Record = { diff --git a/src/app/features/auth/services/auth.service.ts b/src/app/features/auth/services/auth.service.ts index 7666e8c1f..e438336db 100644 --- a/src/app/features/auth/services/auth.service.ts +++ b/src/app/features/auth/services/auth.service.ts @@ -21,6 +21,9 @@ export class AuthService { isAuthenticated(): boolean { const csrfToken = this.cookieService.get('api-csrf'); + const staging = this.cookieService.get('osf_staging4'); + console.log(staging, csrfToken); + console.log(document.cookie); const authenticated = !!csrfToken; this.actions.setAuthenticated(authenticated);