diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/api.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -59,7 +59,7 @@ router.post('/auth/register', (req, res) => { if (key === undefined) { res.status(500).send( {msg: 'Failed to register user'} ); return; } - res.status(200).cookie('auth', key).send({msg: 'Successfully registered new user'}) + res.status(200).cookie('auth', key, { maxAge: 365 * 24 * 60 * 60 * 1000, sameSite: 'strict' }).send({msg: 'Successfully registered new user'}) }) router.post('/auth/login', (req, res) => { @@ -75,7 +75,7 @@ router.post('/auth/login', (req, res) => { if (key === undefined) { res.status(400).send( {msg: 'Invalid login combination'} ); return; } - res.status(200).cookie('auth', key).send({msg: 'Successfully logged in'}) + res.status(200).cookie('auth', key, { maxAge: 365 * 24 * 60 * 60 * 1000, sameSite: 'strict' }).send({msg: 'Successfully logged in'}) }) router.post('/auth/self', (req, res) => { |