proxyAuth: use default expiry time in cookie (1 year)

This commit is contained in:
Girish Ramakrishnan
2021-04-30 10:31:09 -07:00
parent 6fe8974a2d
commit 8ff68331a8
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ function login(req, res, next) {
const error = tokens.validateTokenType(type);
if (error) return next(new HttpError(400, error.message));
tokens.add(type, req.user.id, Date.now() + constants.DEFAULT_TOKEN_EXPIRATION, {}, function (error, token) {
tokens.add(type, req.user.id, Date.now() + constants.DEFAULT_TOKEN_EXPIRATION_MSECS, {}, function (error, token) {
if (error) return next(new HttpError(500, error));
eventlog.add(eventlog.ACTION_USER_LOGIN, auditSource, { userId: req.user.id, user: users.removePrivateFields(req.user) });
@@ -103,7 +103,7 @@ function passwordReset(req, res, next) {
if (error && error.reason === BoxError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error) return next(BoxError.toHttpError(error));
tokens.add(tokens.ID_WEBADMIN, userObject.id, Date.now() + constants.DEFAULT_TOKEN_EXPIRATION, {}, function (error, result) {
tokens.add(tokens.ID_WEBADMIN, userObject.id, Date.now() + constants.DEFAULT_TOKEN_EXPIRATION_MSECS, {}, function (error, result) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, { accessToken: result.accessToken }));