volto icon indicating copy to clipboard operation
volto copied to clipboard

Reset Password UI crash on invalid username

Open mamico opened this issue 2 months ago • 4 comments

Describe the bug Reset Password UI crash on invalid username

To Reproduce Steps to reproduce the behavior:

  1. Go to https://demo.plone.org/passwordreset/b78200e82a05411e9e20857bd9aa9d49
  2. type fake username and password, eg. 'user.foo', 'password.bar'
  3. Click on the continue arrow
  4. 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

Image

Software (please complete the following information):

  • Volto 18.27.3
  • Plone 6.1.3
  • plone.restapi 9.15.3

mamico avatar Oct 21 '25 16:10 mamico

I'd like to fix this bug. Please assign this to me if it's available.

avinxshKD avatar Oct 22 '25 05:10 avinxshKD

@avinxshKD We don't assign issues. Please read https://6.docs.plone.org/contributing/first-time.html

davisagli avatar Oct 22 '25 05:10 davisagli

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.

suhaibfida avatar Nov 01 '25 15:11 suhaibfida

I have solved the issue, waiting for the contributor invitation . Once I get that , I will open the PR .

SumitSingh69 avatar Nov 14 '25 04:11 SumitSingh69