Return password reset link on reset request route
This commit is contained in:
@@ -80,10 +80,10 @@ async function logout(req, res) {
|
||||
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)));
|
||||
const [error, result] = await safe(users.sendPasswordResetByIdentifier(req.body.identifier, auditSource.fromRequest(req)));
|
||||
if (error && error.reason !== BoxError.NOT_FOUND) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
next(new HttpSuccess(202, { resetLink: result }));
|
||||
}
|
||||
|
||||
async function passwordReset(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user