From 86b259fd3e0cdc52b148b37d455a84a87882bc9c Mon Sep 17 00:00:00 2001 From: nidhish-nayak Date: Sun, 24 Mar 2024 00:47:49 +0530 Subject: [PATCH] Adding sameSite as server --- server/src/controllers/auth/login.controller.ts | 2 +- server/src/controllers/auth/logout.controller.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/controllers/auth/login.controller.ts b/server/src/controllers/auth/login.controller.ts index 17ad6a9..826f418 100644 --- a/server/src/controllers/auth/login.controller.ts +++ b/server/src/controllers/auth/login.controller.ts @@ -45,7 +45,7 @@ export const login = async (req: Request, res: Response) => { sameSite: "none", secure: true, httpOnly: true, - domain: config.server, + domain: ".vercel.app", // set 1 day token expiry maxAge: 24 * 60 * 60 * 1000, }) diff --git a/server/src/controllers/auth/logout.controller.ts b/server/src/controllers/auth/logout.controller.ts index ee8882f..63ad3c2 100644 --- a/server/src/controllers/auth/logout.controller.ts +++ b/server/src/controllers/auth/logout.controller.ts @@ -3,8 +3,9 @@ import { type Request, type Response } from "express"; export const logout = (_req: Request, res: Response) => { res.clearCookie("accessToken", { httpOnly: true, - secure: true, sameSite: "none", + secure: true, + domain: ".vercel.app", }) .status(200) .send("User has been logged out.");