Skip to content

Conversation

@SumitSingh69
Copy link
Member

@SumitSingh69 SumitSingh69 commented Nov 15, 2025

Fixes #7533

Before (when there was no error handling for invalid username/password) :

503770663-fc2f60f7-c417-4596-b824-33374340d689

After (proper error handling) :
Screenshot 2025-11-15 at 5 46 31 PM

Screenshot 2025-11-15 at 5 45 59 PM

Quick gist of what I did :

The Reset Password form was crashing when the username was invalid or when the backend returned an error.
This happened because UNSAFE_componentWillReceiveProps(nextProps) only handled the successful submission case.
In failure cases, no error message was set, leaving error = null, which caused the UI to break when accessed.

🔧 What I changed

Added error handling inside UNSAFE_componentWillReceiveProps(nextProps) for unsuccessful form submissions.

Added both:

Personalized error messages (e.g., invalid username, bad request, etc.)

A fallback generic error message for unexpected cases.

Ensures error is always a string, preventing UI crashes.

✅ Result

The form now behaves correctly:

Success → loads normally

Failure → shows the appropriate error message

No more error is null UI crashes

Let me know , if we need addons in this @stevepiercy @mamico

@boring-cyborg
Copy link

boring-cyborg bot commented Nov 15, 2025

Caution

The Volto Team has suspended its review of new pull requests from first-time contributors until the release of Plone 7, which is preliminarily scheduled for the second quarter of 2026.
Read details.

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, read
Plone's Code of Conduct,
Contributing to Plone,
First-time contributors, and
Contributing to Volto,
as this will greatly help the review process.

Welcome to the Plone community! 🎉

@mister-roboto
Copy link

@SumitSingh69 you need to sign the Plone Contributor Agreement to merge this pull request.

Learn about the Plone Contributor Agreement: https://plone.org/foundation/contributors-agreement

If you have already signed the agreement, please allow a week for your agreement to be processed.
Once it is processed, you will receive an email invitation to join the plone GitHub organization as a Contributor.

If after a week you have not received an invitation, then please contact [email protected].

@SumitSingh69
Copy link
Member Author

i have accepted the contributor agreement, Kindly review this pull request .

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messages look good. Needs a final technical review.

Does this PR need new test cases?

@stevepiercy stevepiercy requested review from a team and mamico November 24, 2025 06:35
@github-project-automation github-project-automation bot moved this to Needs discussion in Volto Team Meeting Nov 24, 2025
@stevepiercy stevepiercy moved this from Needs discussion to Plan approved in Volto Team Meeting Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Plan approved

Development

Successfully merging this pull request may close these issues.

Reset Password UI crash on invalid username

4 participants