From 0f56303d5942f6484f99006b488cfab9dc4e513f Mon Sep 17 00:00:00 2001 From: kusowl Date: Thu, 5 Mar 2026 14:43:21 +0530 Subject: [PATCH] fix sanctum and session environment variables --- backend/.env.example | 3 ++- src/app/app.config.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index 42976e2..2e68f92 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -31,7 +31,7 @@ SESSION_DRIVER=database SESSION_LIFETIME=120 SESSION_ENCRYPT=false SESSION_PATH=/ -SESSION_DOMAIN=null +SESSION_DOMAIN=localhost BROADCAST_CONNECTION=log FILESYSTEM_DISK=local @@ -64,3 +64,4 @@ AWS_USE_PATH_STYLE_ENDPOINT=false VITE_APP_NAME="${APP_NAME}" FRONTEND_URL=http://localhost:4200 +SANCTUM_STATEFUL_DOMAINS=localhost:4200 diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 0c81531..5003afb 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,14 +1,14 @@ -import { ApplicationConfig, provideBrowserGlobalErrorListeners } from "@angular/core"; -import { provideRouter, withComponentInputBinding } from "@angular/router"; +import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core'; +import { provideRouter, withComponentInputBinding } from '@angular/router'; -import { routes } from "./app.routes"; -import { provideHttpClient, withFetch, withInterceptors } from "@angular/common/http"; -import { csrfInterceptor } from "./core/interceptors/csrf-interceptor"; +import { routes } from './app.routes'; +import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/http'; +import { csrfInterceptor } from './core/interceptors/csrf-interceptor'; export const appConfig: ApplicationConfig = { providers: [ provideBrowserGlobalErrorListeners(), provideRouter(routes, withComponentInputBinding()), - provideHttpClient(withFetch(), withInterceptors([csrfInterceptor])), + provideHttpClient(withInterceptors([csrfInterceptor])), ], };