Add view password functionality to login form#4714
Conversation
|
Functionality looks fine |
| <% end %> | ||
|
|
||
| <script> | ||
| document.getElementById('toggle_password').onclick = function () { |
There was a problem hiding this comment.
Can we package this into a Stimulus controller? That's the way we want to encourage sprinkling JavaScript into our pages. You can see an example here: https://github.com/rubyforgood/human-essentials/blob/8839e19eb67ed92fb4c96fa7a98beab2ddf9e09f/app/javascript/controllers/highchart_controller.js#L32-L32 and it's used
There was a problem hiding this comment.
Hi Dorner,
I've refactored the password toggle into a Stimulus controller as requested. It’s now encapsulated neatly in the password_visibility_controller.js, making our JS integration more structured.
|
Also, erb lint is failing - see above. |
|
Awesome, thanks! |
|
@princekumarg12: Your PR |
Resolves #4671
Description
This change implements an "eyeball" icon functionality on the login page, allowing users to toggle password visibility. This feature aims to improve user experience by enabling users to confirm their password entry, reducing login errors due to typos.
This solution balances usability with security, ensuring the password is hidden by default.
No additional dependencies are required for this change.
Type of change
How Has This Been Tested?
I implemented unit tests to verify the password toggle functionality: