patch https cookies in production

This commit is contained in:
Sorrel Bri 2020-01-18 23:53:42 -08:00
parent 082cf29470
commit 34abfa9d29

View file

@ -13,9 +13,9 @@ const signToken = (res, user) => {
return res.cookie('token', token, {
expires: new Date(Date.now() + expiration),
domain: process.env.DOMAIN,
// secure: false, // set to true if your using https
httpOnly: true
// path: '/api/v1'
secure: process.env.NODE_ENV === 'production' ? true : false,
httpOnly: true,
sameSite: 'Strict'
});
};
module.exports = signToken;