|
@@ -79,18 +79,13 @@ module.exports = (crowi) => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- router.put('/', apiLimiter, csrf, injectResetOrderByTokenMiddleware, validator.password, apiV3FormValidator, async(req, res) => {
|
|
|
|
|
- if (req.error != null) {
|
|
|
|
|
- if (req.error === 'Token not found') {
|
|
|
|
|
- return res.json({ status: 404, error: req.error });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ router.put('/', /* apiLimiter, */ csrf, injectResetOrderByTokenMiddleware, validator.password, apiV3FormValidator, async(req, res) => {
|
|
|
|
|
|
|
|
- if (req.error === 'passwordResetOrder is null or expired or revoked') {
|
|
|
|
|
- return res.json({ status: 400, error: req.error });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (req.error != null) {
|
|
|
|
|
+ return res.apiv3Err(req.error.message);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const passwordResetOrder = req.passwordResetOrder;
|
|
|
|
|
|
|
+ const { passwordResetOrder } = req;
|
|
|
const { email } = passwordResetOrder;
|
|
const { email } = passwordResetOrder;
|
|
|
const grobalLang = configManager.getConfig('crowi', 'app:globalLang');
|
|
const grobalLang = configManager.getConfig('crowi', 'app:globalLang');
|
|
|
const i18n = req.language || grobalLang;
|
|
const i18n = req.language || grobalLang;
|