summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2023-01-22 20:47:39 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2023-01-22 20:47:39 -0500
commit5fe8ea1b85299564686f3fba331644e1178f363e (patch)
tree5ec235febb3957507a1dcdee8cf71c1d9b69011d /src
parentincrease post limit (diff)
downloadxssbook-5fe8ea1b85299564686f3fba331644e1178f363e.tar.gz
xssbook-5fe8ea1b85299564686f3fba331644e1178f363e.tar.bz2
xssbook-5fe8ea1b85299564686f3fba331644e1178f363e.zip
bug fixes
Diffstat (limited to 'src')
-rw-r--r--src/api.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api.js b/src/api.js
index 3e4cb4d..01edfc6 100644
--- a/src/api.js
+++ b/src/api.js
@@ -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) => {