Function
update
({ params: { token }, bodymen: { body: { password } } }, res, next)
Source from the content-addressed store, hash-verified
| 33 | .catch(next) |
| 34 | |
| 35 | export const update = ({ params: { token }, bodymen: { body: { password } } }, res, next) => { |
| 36 | return PasswordReset.findOne({ token }) |
| 37 | .populate('user') |
| 38 | .then(notFound(res)) |
| 39 | .then((reset) => { |
| 40 | if (!reset) return null |
| 41 | const { user } = reset |
| 42 | return user.set({ password }).save() |
| 43 | .then(() => PasswordReset.deleteMany({ user })) |
| 44 | .then(() => user.view(true)) |
| 45 | }) |
| 46 | .then(success(res)) |
| 47 | .catch(next) |
| 48 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected