Hi, I’m using Google OAuth in my app (on a AWS VM), and it works well overall. However, sometimes I need to double-click the login button to trigger the redirect. I’ve tried several solutions, but the issue persists even in the raw code. Any thoughts on how to resolve this?
The code:
import streamlit as st
from streamlit_google_auth import Authenticate
import streamlit.components.v1 as components
if 'connected' not in st.session_state:
authenticator = Authenticate(
secret_credentials_path = 'client.json',
cookie_name="mycookie",
cookie_key="mykey",
redirect_uri = "https://mydomain.com" ,
)
st.session_state["authenticator"] = authenticator
# Catch the login event
st.session_state["authenticator"].check_authentification()
# Create the login button
st.session_state["authenticator"].login()
if st.session_state['connected']:
st.image(st.session_state['user_info'].get('picture'))
st.write('Hello, '+ st.session_state['user_info'].get('name'))
st.write('Your email is '+ st.session_state['user_info'].get('email'))
if st.button('Log out'):
st.session_state["authenticator"].logout()