mkhorasani / Streamlit-Authenticator

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

login widget doesn't disappear after successful login #222

Closed ai4ki closed 1 month ago

ai4ki commented 1 month ago

Thanks a lot for this! I have a minor issue: The login widget doesn't disappear after successful login; it only disappears once you interact with the app for the first time. I unelegantly solved this with an automatic st.rerun() but I'm wondering if I'm missing something. I simply use the example code, nothing else.

mkhorasani commented 1 month ago

Dear @ai4ki, thank you for reaching out. Please provide the config file as a path to the Authenticate class as follows:

authenticator = stauth.Authenticate('<path to config file>/config.yaml')

This will solve this problem and it will also eliminate the need for you to update the config file, as it will automatically be updated.

ai4ki commented 1 month ago

Thanks @mkhorasani for your fast reply! I tried your solution but it didn't work. Turns out the problem was the "expiry_days" param. I had set it to 0 and this casues the widget to remain visible after login. For value >0 it disappears as intended.