diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-22 20:47:39 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-22 20:47:39 -0500 |
commit | 5fe8ea1b85299564686f3fba331644e1178f363e (patch) | |
tree | 5ec235febb3957507a1dcdee8cf71c1d9b69011d /src | |
parent | increase post limit (diff) | |
download | xssbook-5fe8ea1b85299564686f3fba331644e1178f363e.tar.gz xssbook-5fe8ea1b85299564686f3fba331644e1178f363e.tar.bz2 xssbook-5fe8ea1b85299564686f3fba331644e1178f363e.zip |
bug fixes
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) => { |