Skip to content

Commit 2ae1dc4

Browse files
authored
Merge pull request #43 from adity1raut/aditya-side
fix(auth): update cookie options for production environment
2 parents 7832734 + 2d4cc82 commit 2ae1dc4

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)