π Bugfix: Reset password strength indicator when re-entering registration modal#3210
Open
Dr1985 wants to merge 1 commit into
Open
π Bugfix: Reset password strength indicator when re-entering registration modal#3210Dr1985 wants to merge 1 commit into
Dr1985 wants to merge 1 commit into
Conversation
The passwordValue state was not being cleared when the registration
modal re-opened, causing the password strength bar to persist from
a previous registration attempt. Added setPasswordValue("") to both
resetForm() and the modal-open useEffect.
Fixes ModelEngine-Group#3204
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The passwordValue state was not being cleared when the registration modal re-opened, causing the password strength bar to persist from a previous registration attempt. Added setPasswordValue("") to both resetForm() and the modal-open useEffect.
Fixes #3204
Description
Problem
After registering, logging out, and re-entering the registration page, the password strength indicator bar does not reset to empty. It continues showing the strength level of the previously entered password.
Root Cause
In
frontend/components/auth/registerModal.tsx, the password strength indicator is conditionally rendered based on thepasswordValueReact state:When the registration modal re-opens:
form.resetFields()was called, which clears the AntD form fieldspasswordValuestate variable was never reset β it retained the old password valuepasswordValuewas still truthy, the old strength indicator persistedFix
Added
setPasswordValue("")in two places:resetForm()function (line 76) β ensures password strength clears after successful registration or when switching to login modaluseEffectwhen modal opens (line 148) β ensures password strength clears when the registration modal re-opens after logoutFiles Changed
Testing
StrongP@ss1) β observe the strength indicator appears