lugenx/ecohabit

Preserve User Input on Registration and Login Errors

Closed this issue · 3 comments

lugenx commented

Currently, when a user encounters an error during registration or login, all input fields are cleared. This can be inconvenient as users have to re-enter all their information.

To improve this, we'd like to:

  1. Update the handleSubmit function in both components so that clearData is only called when the process is successful. This allows us to keep user input if an error occurs.

  2. For security reasons, we should clear the 'password' and 'confirm password' fields in registration, and 'password' field in login even when an error occurs. Please incorporate this into the respective handleSubmit functions.

Upon completion, we should see:

  • User input fields (except for password fields) are retained when an error occurs during registration.
  • Password and 'confirm password' fields in registration, and 'password' field in login are always cleared after a submission attempt.

Hi @lugenx , Can you please assign this to me?
I will work on this issue. Thanks

lugenx commented

hi @kunal8411 , assigned, thank you 👍

Hi @lugenx I have created a PR for this issue, Please let me know if there is any enhancement I need to do, I will update PR accordingly. Thanks