Closed DominikZabron closed 11 months ago
I think putting authenticator._check_cookie()
might be enough, is there any better way?
Please ensure your cookie_expiry_days is greater than 0, if that's not already the case.
Cookie expiry_days: 30
.
I have multipage app, I need to switch page once for the _check_cookie()
to work. I try to understand what is different on first load.
Ok, my solution was to explicitly call _check_cookie()
as the top auth operation. I suppose something weird is happening on the session_state, so the order of operations matter, I think it's possible that if "authentication_status" not in st.session_state; st.session_state["authentication_status"] = None
or similar create some race condition.
I implemented all the instructions from the readme and they just work fine, however, when I reload the app (the cookie is still present, I can see it on the st.session_state.init together with _xsrf), but it don't trigger automatic login.
Which piece of code do I miss to trigger automatic login based on a cookie?