Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save user controller returning current password error with incorrect key? #4169

Closed
samhibberd opened this issue Apr 23, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@samhibberd
Copy link

commented Apr 23, 2019

Description

The save user controller requires the current password to update email, username or password. It correctly returns the error if currentPassword is not set or incorrect, although it requires an input called password is sent to the controller, but returns and error with the key currentPassword. Not sure if / why this is, as for us it's causing some complication when adding errors to forms using javascript.

Should it not be named the same password?

Steps to reproduce

  1. Create a front end template profile form template, posting using ajax when requesting a password change but send invalid current password.
  2. Check response.

Additional info

  • Craft version: 3.1.23
  • PHP version: 7.1.25
  • Database driver & version: MySQL 5.5.5

@samhibberd samhibberd changed the title Save user returns currentPassword error key Save user returns current password error with `currentPassword` key rather than `password` Apr 23, 2019

@samhibberd samhibberd changed the title Save user returns current password error with `currentPassword` key rather than `password` Save user returns current password error with currentPassword key rather than password Apr 23, 2019

@samhibberd samhibberd changed the title Save user returns current password error with currentPassword key rather than password Save user returning current password error with incorrect key? Apr 23, 2019

@samhibberd samhibberd changed the title Save user returning current password error with incorrect key? Save user controller returning current password error with incorrect key? Apr 23, 2019

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

Agree that’s a bit awkward. As of the next release Craft will check for an input named currentPassword in addition to password.

@samhibberd

This comment has been minimized.

Copy link
Author

commented Apr 24, 2019

Perfect! Thanks @brandonkelly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.