Skip to content

Commit

Permalink
Adding sameSite as server
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhish-nayak committed Mar 23, 2024
1 parent 5ab5a7e commit 86b259f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/src/controllers/auth/login.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down
3 changes: 2 additions & 1 deletion server/src/controllers/auth/logout.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 86b259f

Please sign in to comment.