Google sign in with landing page works fine - issue on refresh - session lost and GetAccessTokenError: {'error': 'invalid_grant', 'error_description': 'Bad Request'}

Hey @Brijesh_Srikanth1,

Thanks for sharing this question!

You mentioned that you want the session to be maintained across refreshes of the browser. Unfortunately, refreshing your browser ends your session and creates a new one, so st.session_state will be refreshed.

I think what most folks do in this scenario is keep a token as a parameter in the URL, so that when a user refreshes the browser, you can then grab that same token from the URL and establish that they’ve already authenticated with Google (relevant thread). I implemented some similar functionality a few months ago and that’s what I ended up doing to keep users logged in across browser refreshes.