express-mongo-jwt-boilerplate icon indicating copy to clipboard operation
express-mongo-jwt-boilerplate copied to clipboard

Reset password feature and update user endpoint

Open d0peCode opened this issue 5 years ago • 0 comments

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.

d0peCode avatar Jul 03 '19 18:07 d0peCode