streamlit-google-auth icon indicating copy to clipboard operation
streamlit-google-auth copied to clipboard

Endless re-direct back to login

Open strefli3 opened this issue 1 year ago • 0 comments

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()

strefli3 avatar Sep 01 '24 22:09 strefli3