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

Allow forms with fewer fields #126

Open shkarlsson opened 5 months ago

shkarlsson commented 5 months ago

I suggest allowing for fewer fields in the form. Right now, it seems like all fields are shown, even if a dict with fewer fields is passed as fields to Authenticate.register_user. Furthermore, to allow for Username to be optional, I suggest indexing on Email (which should always be present) instead of Username.

Is this a good idea? Could this be merged if I worked on it?

I see a few places in authenticate.py where the index would need to be replaced with email and some adjusted logic to only show and save what the function parameters call for (and not every field). Is there anything else that would make this more challenging?

mkhorasani commented 5 months ago

Hi @shkarlsson, thank you for reaching out. I am definitely open to the idea of indexing by email as opposed to username as an option. I will attempt to address this in a future release and will keep you posted. Thanks.