fix: set cookie same-site to lax in production
This commit is contained in:
parent
8ed04f07f4
commit
26ba5c9656
1 changed files with 3 additions and 1 deletions
|
@ -6,10 +6,12 @@ import { COOKIE_MAX_AGE, __prod__ } from '../../config/constants/constants';
|
|||
const getSessionMiddleware = () => {
|
||||
const FileStore = SessionFileStore(session);
|
||||
|
||||
const sameSite = __prod__ ? 'lax' : 'none';
|
||||
|
||||
return session({
|
||||
name: 'qid',
|
||||
store: new FileStore(),
|
||||
cookie: { maxAge: COOKIE_MAX_AGE, secure: false, sameSite: 'none', httpOnly: true },
|
||||
cookie: { maxAge: COOKIE_MAX_AGE, secure: false, sameSite, httpOnly: true },
|
||||
secret: config.JWT_SECRET,
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
|
|
Loading…
Add table
Reference in a new issue