mkhorasani / Streamlit-Authenticator

A secure authentication module to validate user credentials in a Streamlit application.
Apache License 2.0
1.37k stars 229 forks source link

No middle name or initials are allowed by authenticator.register_user() #171

Closed tigran123 closed 3 weeks ago

tigran123 commented 3 weeks ago

If "John F. Smith" is not a valid name, then I don't know what is :)

Seriously, here is a screenshot:

image

If I remove the middle initial "F." then of course it will be valid, but the whole point is that the user may wish to have his full name, including any middle initials, to be recorded in the registration data. So this is a bug.

tigran123 commented 3 weeks ago

I can see in the source code in the Validator class here:

https://github.com/mkhorasani/Streamlit-Authenticator/blob/61d7adcb9d7a8c004705607d408be2b7cd425670/streamlit_authenticator/utilities/validator.py#L47

that it is due to the pattern ^[A-Za-z ]+$ not including a dot.

mkhorasani commented 3 weeks ago

Hi @tigran123, thank you for bringing this to my attention. I will modify the Validator class in the next release to take this into consideration, in the meantime I recommend you pass your own Validator object to rectify this issue. Thank!

tigran123 commented 3 weeks ago

Thank you. Is there an example code of how to pass my own Validator object when instantiating stauth.Authenticate()?

mkhorasani commented 3 weeks ago

Unfortunately no, just please create a validator object of your own using the exact structure shown in this file.

tigran123 commented 3 weeks ago

Ok, yes, that sounds simple enough -- initially I was worried due to the size, but upon reading the whole code I realised that most of it was comments. Thanks again!