patch https cookies in production
This commit is contained in:
parent
65bbeb71dd
commit
a8750afa7e
1 changed files with 3 additions and 3 deletions
|
@ -13,9 +13,9 @@ const signToken = (res, user) => {
|
||||||
return res.cookie('token', token, {
|
return res.cookie('token', token, {
|
||||||
expires: new Date(Date.now() + expiration),
|
expires: new Date(Date.now() + expiration),
|
||||||
domain: process.env.DOMAIN,
|
domain: process.env.DOMAIN,
|
||||||
// secure: false, // set to true if your using https
|
secure: process.env.NODE_ENV === 'production' ? true : false,
|
||||||
httpOnly: true
|
httpOnly: true,
|
||||||
// path: '/api/v1'
|
sameSite: 'Strict'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
module.exports = signToken;
|
module.exports = signToken;
|
Loading…
Reference in a new issue