Clarify error message further

This commit is contained in:
Girish Ramakrishnan
2022-11-10 13:46:33 +01:00
parent 3477cf474f
commit e9eeab074a
2 changed files with 3 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ async function passwordResetRequest(req, res, next) {
if (!req.body.identifier || typeof req.body.identifier !== 'string') return next(new HttpError(401, 'A identifier must be non-empty string'));
const [error] = await safe(users.sendPasswordResetByIdentifier(req.body.identifier, AuditSource.fromRequest(req)));
if (error && error.reason !== BoxError.NOT_FOUND) return next(BoxError.toHttpError(error));
if (error && !(error.reason === BoxError.NOT_FOUND || error.reason === BoxError.CONFLICT)) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, {}));
}