-
-
Notifications
You must be signed in to change notification settings - Fork 835
Fix : UI crash in Reset Password form when username/password is invalid #7533 #7623
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
base: main
Are you sure you want to change the base?
Conversation
|
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. Thanks for submitting your first pull request! You are awesome! 🤗 If you haven't done so already, read Welcome to the Plone community! 🎉 |
|
@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. If after a week you have not received an invitation, then please contact [email protected]. |
|
i have accepted the contributor agreement, Kindly review this pull request . |
packages/volto/src/components/theme/PasswordReset/PasswordReset.jsx
Outdated
Show resolved
Hide resolved
stevepiercy
left a comment
There was a problem hiding this 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?
Fixes #7533
Before (when there was no error handling for invalid username/password) :
After (proper error handling) :

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