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

logout() requires browser window reload #145

Closed darshitsharma closed 3 months ago

darshitsharma commented 3 months ago

Hi,

I am using logout() option in the code given below. The functionality is fine, it clears the session states but to render the login() again I have to refresh the browser window. Could anyone help in this case?

image

mkhorasani commented 3 months ago

Hi @darshitsharma, I'm not exactly sure why this is happening but perhaps you can use the following piece of code to remedy it:

if st.button('Logout'):
   authenticator.logout(location='unrendered')
   st.experimental_rerun()