mkhorasani / Streamlit-Authenticator

A secure authentication module to manage user access in a Streamlit application.
Other
1.56k stars 248 forks source link

Adding simple validation for usernames and email fields #52

Closed aandresalvarez closed 1 year ago

aandresalvarez commented 1 year ago

Hi there,

I have submitted a pull request with two functions that validate whether a given username or email address is in the correct format. The valid_username() function checks whether the username only contains letters, numbers, underscores, and hyphens, and whether it is between 4 and 20 characters long. On the other hand, valid_email() checks whether the email address is in the correct format.

The functions have been documented with clear and concise docstrings that include details on the parameters, returns, and any constraints for the input. I have also added regular expressions to validate the input.

Please review my changes and let me know if there's anything I can do to improve the code. Thank you for considering my contribution.

Best regards, Alvaro

mkhorasani commented 1 year ago

This issue has now been resolved with https://github.com/mkhorasani/Streamlit-Authenticator/pull/63. Thank you!