Closed KevinMulhern closed 2 days ago
This might just be an unfortunate result from the review app not having an email provider, but clicking the button on the review app tries to POST to Testing locally - this is definitely caused by something in the review app; works fine on localhosthttps://odin-review-app-pr-4590.herokuapp.com/admin_v2/team_members/1/password_resets
and then returns a 500
Testing locally:
POST: http://localhost:3000/admin_v2/password
Status: 422 Unprocessable Content
Request data: _method "put" authenticity_token "C7ETjvK4bY19EUWBYLv_zp9waXgvgodwKho7uJ07cIE56nncTeZlXlsHGZuKjsC54TQntHDs3YdRPZmeIcujsQ" admin_user[reset_password_token] "vgsHmpEY8q6x8XEUp_7R" admin_user[password] "testpassword123" admin_user[password_confirmation] "testpassword123" commit "Change+my+password"
Thanks for the feedback @Asartea 💪
I've not been able to reproduce the 422 with those steps so far. I've tried with pending/active users, different combos of passwords and deliberately failing validations and then entering a valid password. Is there anything else you can think of that you did different?
I think I've found it. 422 responses happen when the password reset token is no longer valid. I've been able to reproduce that in a couple of ways:
It's somewhat of an edgecase. But you're right, we should provide feedback when it happens. I've updated the branch to include an error message.
Great spot 🚀
Note: This can't be tested on the review app but can be tested locally. We don't have an email provider available on review apps.
Steps for QA:
I think I've found it. 422 responses happen when the password reset token is no longer valid. I've been able to reproduce that in a couple of ways:
Yeah, it was probably one of these.
Trying to submit two different passwords:
And just to check the previous issue:
Overall: LGTM :rocket:
Because:
This commit