Skip to content

Commit 2d4cc82

Browse files
committed
fix(auth): update cookie options for production environment
1 parent 694dc22 commit 2d4cc82

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server/app/controllers/authController.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ function generateOtp() {
3737
}
3838

3939
const COOKIE_NAME = process.env.COOKIE_NAME || "sc_token";
40+
const isProd = process.env.NODE_ENV === "production";
4041
const COOKIE_OPTS = {
4142
httpOnly: true,
42-
secure: process.env.NODE_ENV === "production",
43-
sameSite: "lax",
43+
secure: isProd,
44+
sameSite: isProd ? "none" : "lax",
4445
maxAge: parseInt(process.env.JWT_COOKIE_MAX_AGE) || 604800000,
4546
};
4647

0 commit comments

Comments
 (0)