mkhorasani / Streamlit-Authenticator

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

Question: where I can find new password after I clicked "forgot_password" #75

Closed yuxuan7z closed 11 months ago

yuxuan7z commented 11 months ago

Hi,

Thank you for creating this powerful Authenticator tool. I have a question about 'Forgot password' widget. After I submitted my forgot password request by username, where I can find the new generated random password? I did not receive an email to my account about new password information. The config.yaml file's password is hashed and how I suppose to get the new random password from my yaml file? Thank you very much for your help.

mkhorasani commented 11 months ago

Hi @yuxuan7z, thank you for reaching out. Please note that this widget does not automatically email the user their new random password. Instead it returns the new random password as a string and you will then have to develop your own code to send it to them in any way that you require. For further information please refer to point number 6 in the readme file.

yuxuan7z commented 11 months ago

Hi @mkhorasani, thank you very much for your quick answer. I am new to streamlit and I do not understand 'The widget will return the username, email, and new random password of the user which should then be transferred to them securely' well. Where I can find the new returned username, email and new random password? In config.yaml file? But the password is hashed, how can I get the new password?

mkhorasani commented 11 months ago

No worries. In the line below, the variable new_random_password catches the returned password as a string, which you can then use in any way you like.

username_of_forgotten_password, email_of_forgotten_password, new_random_password = authenticator.forgot_password('Forgot password')
yuxuan7z commented 11 months ago

@mkhorasani Thank you so much! Really appreciate your help!