Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Make cookie persistent
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXyfir committed Mar 5, 2019
1 parent 84543bf commit 01bfb94
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/api/login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function api_login(
): void {
login(req.body.email, req.body.pass, req.body.otp)
.then(token => {
res.cookie(JWT_COOKIE_NAME, token);
res.cookie(JWT_COOKIE_NAME, token, { maxAge: 31540000000 });
res.status(200).json({});
})
.catch(next);
Expand Down
2 changes: 1 addition & 1 deletion server/api/login/passwordless/finish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function api_finishPasswordlessLogin(
req.redirect = true;
finishPasswordlessLogin(req.jwt)
.then(token => {
res.cookie(JWT_COOKIE_NAME, token);
res.cookie(JWT_COOKIE_NAME, token, { maxAge: 31540000000 });
res.redirect(ACCOWNT_WEB_URL);
})
.catch(next);
Expand Down
2 changes: 1 addition & 1 deletion server/api/register/finish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function api_finishRegistration(
req.redirect = true;
finishRegistration(req.jwt)
.then(token => {
res.cookie(JWT_COOKIE_NAME, token);
res.cookie(JWT_COOKIE_NAME, token, { maxAge: 31540000000 });
res.redirect(ACCOWNT_WEB_URL);
})
.catch(next);
Expand Down

0 comments on commit 01bfb94

Please sign in to comment.