mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-07 14:35:26 +02:00
Set auth cookie lifetime
This commit is contained in:
parent
40d5285e5e
commit
e0aeeba117
1 changed files with 4 additions and 1 deletions
|
@ -51,7 +51,10 @@ router.post('/auth', parseForm, csrfProtection, async (req, res) => {
|
|||
iat: Date.now(),
|
||||
}, passHash + config.secret);
|
||||
|
||||
res.cookie('authToken', token, { httpOnly: true });
|
||||
res.cookie('authToken', token, {
|
||||
httpOnly: true,
|
||||
expires: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000) // 1 year
|
||||
});
|
||||
|
||||
res.redirect('/');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue