express-mongo-jwt-boilerplate
express-mongo-jwt-boilerplate copied to clipboard
Reset password feature and update user endpoint
This PR contains following:
- reset password endpoints which expect to get
email
and send mail with randomly generated password.-
router.post('/resetStart', auth(), userController.reset.sendMail)
send email -
router.get('/resetConfirm', userController.reset.updatePass)
(entered from link in mail) confirm password change
-
- update user endpoint*
-
router.put('/update', validator(update), auth(), userController.update)
-
*With security in mind I don't allow to update every field. I've created validation with Joi
which allow only password
and name
change. However it can be easily configure by other developer to his own need.