-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
We need to add a POST /password/reset endpoint as the last step to reset a user's password
- Takes in
[:value, :password, :password_confirmation] - Finds
AuthTokenby:value, as well as associatedUser - Uses [
Phoenix.Token.verify/4] to verify the token is correct and not expired or anything like that. - If all is in order, updates the user with new password
- For this, w need a
User.reset_password_changesetwhich casts and validates:passwordand:password_confirmation. It should ensure the two match before encrypting and assigning the new password. This can be done as a separate issue in CreateUser.reset_password_changeset/2#728 - Endpoint should render validation errors if the changeset is invalid
- For this, w need a
Subtasks
- add endpoint to router
- add
PasswordResetController.reset_password - past this point, we are blocked by Create
User.reset_password_changeset/2#728 - ensure endpoint renders 200 OK if reset passes
- ensure endpoint renders 422 if reset fails due to password mismatch
- add controller tests
References
Progress on: #498