Thanks to visit codestin.com
Credit goes to github.com

Skip to content

When changing a password, it silently trims space characters from inside on every value change trigger #5638

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

Closed
rac2030 opened this issue Jan 9, 2023 · 3 comments · Fixed by #5640
Assignees
Labels
site Area: frontend dashboard

Comments

@rac2030
Copy link
Contributor

rac2030 commented Jan 9, 2023

If a user is changing his password (SettingsSecurityForm.tsx) and enters a space, it will not be in the value but no error message is displayed that it's an invalid character.

This can result in a user setting a password with spaces in it like "some random sentence" which will result that he actually changed his password to "somerandomsentence" without seeing it. As he can enter that phase with spaces in the confirmation as well and they will match, he will only figure out that he can not login anymore with that password after it has been updated.

If however he copy pastes into the password field, a space character is possible so I'm not sure if the bug is not showing an error message or trimming on every change of the field.

@coadler coadler added bug site Area: frontend dashboard labels Jan 9, 2023
@rac2030 rac2030 changed the title Password with spaces silently removes them when changing a password When changing a password, it silently trims space characters from inside on every value change trigger Jan 9, 2023
@rac2030
Copy link
Contributor Author

rac2030 commented Jan 9, 2023

From my understanding of a quick look at the code without cloning or building it looks to me that the problem is with the on Change listener that trims which is added to the password field on the settings page:

@rac2030
Copy link
Contributor Author

rac2030 commented Jan 9, 2023

Created a PR removing the OnChange listener as after further inspection of the code base it seems that other forms in coder that set the user password all have no OnChange listener set for the password fields

@ghuntley
Copy link
Contributor

ghuntley commented Jan 9, 2023

Thanks for raising the pull-request and the detailed bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site Area: frontend dashboard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants