MrBounty / streamlit-google-auth

MIT License
28 stars 12 forks source link

Endless re-direct back to login #11

Open strefli3 opened 2 months ago

strefli3 commented 2 months ago

On some days, this module continues to re-direct and show the login button. I have been able to solve the issue by updating time.sleep() to 2.0 seconds in the check_authentification() function.

To hide the login button during this sleep, the following seems to do the trick:

if 'user_info' in st.session_state and ( st.session_state["user_info"].get("email").lower() in email_list ):
  # app here
elif st.session_state["connected"] and (
    st.session_state["user_info"].get("email").lower() not in email_list
):
    st.text("Unauthorized!")
else:
    st.session_state["authenticator"].login()