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

Refresh Page Would Lost Login and the way to fix it #159

Closed qiang-yu closed 1 month ago

qiang-yu commented 1 month ago

version streamlit-authenticator==0.3.2

I have read the document which only says "Multi Page" you need to call authenticator.login() in every Page

But , i have only single page, my problem is , every time i refresh the browser, the page would throw an exception "authentication_status not in st.session_state"

Here is the way to fix this problem :

streamlit_authenticator\authenticate\init.py

Screenshot_3

streamlit_authenticator\authenticate\cookie\init.py

Screenshot_2

Just Change these two lines , and you can Refresh your page now , eveything is OK

Hope you guys can fix this bug in next release

thanks

mkhorasani commented 1 month ago

Hi @qiang-yu, both parts are already implemented as shown below:

image