Skip to content

πŸ› Bugfix: Reset password strength indicator when re-entering registration modal#3210

Open
Dr1985 wants to merge 1 commit into
ModelEngine-Group:mainfrom
Dr1985:issue-3204
Open

πŸ› Bugfix: Reset password strength indicator when re-entering registration modal#3210
Dr1985 wants to merge 1 commit into
ModelEngine-Group:mainfrom
Dr1985:issue-3204

Conversation

@Dr1985

@Dr1985 Dr1985 commented Jun 9, 2026

Copy link
Copy Markdown

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 the passwordValue React state:

{passwordValue && (() => { ... })()}

When the registration modal re-opens:

  • form.resetFields() was called, which clears the AntD form fields
  • However, the passwordValue state variable was never reset β€” it retained the old password value
  • Since passwordValue was still truthy, the old strength indicator persisted

Fix

Added setPasswordValue("") in two places:

  1. resetForm() function (line 76) β€” ensures password strength clears after successful registration or when switching to login modal
  2. useEffect when modal opens (line 148) β€” ensures password strength clears when the registration modal re-opens after logout

Files Changed

File Change
frontend/components/auth/registerModal.tsx +2 lines: setPasswordValue("") in resetForm() and in the modal-open useEffect

Testing

  1. Open the registration modal
  2. Type a password (e.g., StrongP@ss1) β€” observe the strength indicator appears
  3. Register successfully, then logout
  4. Re-open the registration modal
  5. Expected: Password field is empty and password strength indicator is hidden
  6. Before fix: Password strength indicator still showed the old strength level

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
@Dr1985 Dr1985 requested review from Dallas98 and WMC001 as code owners June 9, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Need to reset password strength indicator when re-entering registration page after logout

1 participant