Reset Password UI crash on invalid username
Describe the bug Reset Password UI crash on invalid username
To Reproduce Steps to reproduce the behavior:
- Go to https://demo.plone.org/passwordreset/b78200e82a05411e9e20857bd9aa9d49
- type fake username and password, eg. 'user.foo', 'password.bar'
- Click on the continue arrow
- See error
Expected behavior A message that says the username is invalid, or one that explains that if the username exists, the user will receive an email with instructions (to avoid user enumeration).
Screenshots
Software (please complete the following information):
- Volto 18.27.3
- Plone 6.1.3
- plone.restapi 9.15.3
I'd like to fix this bug. Please assign this to me if it's available.
@avinxshKD We don't assign issues. Please read https://6.docs.plone.org/contributing/first-time.html
I found the solution for the issue. The problem was with the error handling logic.
✅ Updated logic:
const errmsg = this.props.error?.response?.body?.error || null; error = {this.state.error || errmsg || this.props.error};
This safely handles nested error responses using optional chaining.
I wasn’t able to complete the test case for it, so I’m closing this PR for now. This is the solution I reached — feel free to build upon it in future updates.
I have solved the issue, waiting for the contributor invitation . Once I get that , I will open the PR .