From 61caa58df1c59b067c58cc542b8ddcc90c6cab9c Mon Sep 17 00:00:00 2001 From: Sreesanjay Date: Sun, 10 Mar 2024 18:09:59 +0530 Subject: [PATCH] fix: samesite changed --- client/src/features/authSlice.js | 4 ++-- server/app.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/features/authSlice.js b/client/src/features/authSlice.js index f977085..377ec7d 100644 --- a/client/src/features/authSlice.js +++ b/client/src/features/authSlice.js @@ -38,7 +38,7 @@ const authSlice = createSlice({ localStorage.setItem("user", JSON.stringify(action.payload.user)); Cookies.set("token", action.payload.token, { secure: true, - sameSite: "Lax", + sameSite: "none", path: '/', expires: 3, }); @@ -59,7 +59,7 @@ const authSlice = createSlice({ localStorage.setItem("user", JSON.stringify(action.payload.user)); Cookies.set("token", action.payload.token, { secure: true, - sameSite: "Lax", + sameSite: "none", path: '/', expires: 3, }); diff --git a/server/app.js b/server/app.js index 3ea040b..e0f04a7 100644 --- a/server/app.js +++ b/server/app.js @@ -10,9 +10,9 @@ const { notFound, errorHandler } = require('./middlewares/errorMiddlewares') const userRoute = require('./routes/indexRoute.js') const adminRoute = require('./routes/adminRoute.js') // const ORIGIN = process.env.NODE_ENV === 'development' ? "http://localhost:4000" : 'https://thalia.vercel.app' -// const ORIGIN = ["http://localhost:4000", 'https://thalia.vercel.app'] +const ORIGIN = ["http://localhost:4000", 'https://thalia.vercel.app'] const corsConfig = { - origin: "*", + origin: ORIGIN, credentials: true, };