Skip to content
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

Suggested improvement: Remove spaces in input text in login form to prevent failed login during autocomplete #157

Open
agomezh opened this issue May 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@agomezh
Copy link

agomezh commented May 5, 2024

My browser autocompletes certain logins. It did with streamlit authenticator, but it (for some reason), added a space at the end. Therefore instead of 'my_username' it was 'my_username '. This prompted the authenticator to fail.

My suggestion is to add .strip() in the result of the username when logging in.

Line 197 of https://github.com/mkhorasani/Streamlit-Authenticator/blob/main/streamlit_authenticator/authenticate/__init__.py

From:

username = login_form.text_input('Username' if 'Username' not in fields else fields['Username']).lower()

To:

username = login_form.text_input('Username' if 'Username' not in fields else fields['Username']).lower().strip()

I would create a pull request, but I simply don't feel comfortable yet proposing such changes, so better to raise it here and discuss it if necessary.

Thank you for the component :).

@mkhorasani mkhorasani added the enhancement New feature or request label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants