Invite links do not depend on resetToken expiration

This commit is contained in:
Johannes Zellner
2021-12-28 16:34:47 +01:00
parent 9a71360346
commit b531a10392

View File

@@ -134,9 +134,6 @@ async function setupAccount(req, res, next) {
if (error) return next(new HttpError(401, 'Invalid inviteToken'));
if (!userObject) return next(new HttpError(401, 'Invalid inviteToken'));
// if you fix the duration here, the emails and UI have to be fixed as well
if (Date.now() - userObject.resetTokenCreationTime > 7 * 24 * 60 * 60 * 1000) return next(new HttpError(401, 'Token expired'));
const [setupAccountError, accessToken] = await safe(users.setupAccount(userObject, req.body, AuditSource.fromRequest(req)));
if (setupAccountError) return next(BoxError.toHttpError(setupAccountError));