Currently on 1.44, locally hosted, and I recently experimented with a multipage site using st.navigation. I have created a simple account page with a logout button, but whenever I click it, it loads this “/auth/logout” but the logout doesn’t actually occur. I’m logging in using st.login connected to Microsoft SSO.
import streamlit as st
st.write(f"Hello, {st.experimental_user.name}!")
if st.button("Logout"):
st.logout()
```
Thanks for the suggestion. Is this what you had in mind?
import streamlit as st
st.write(f"Hello, {st.experimental_user.name}!")
if st.button("Logout"):
st.logout()
st.rerun()
If so, I tested it, but when clicking the Logout button, i’m still redirected to http://localhost:8501/auth/logout with no logout occurring. The auth/logout page isn’t something that I setup. It seems to be a result of the st.logout() function, but I was thinking it should clear the experimental_user settings and redirect me to my homepage instead.
I ended up getting it fixed. It was just a very bizarre chain of events on my side that led to the error. But just in case someone else struggles through it, this is what happened.
I had already created my streamlit project and logged in using st.login(), but then I moved it over to a new virtual environment. Once I relaunched it, I was still logged in based off my previous login, so all seemed well. But then I finally stumbled upon the error when I went to login again in a different browser. I hadn’t installed Authlib in my new virtual environment, so that was preventing the logout from functioning correctly, but not returning an error. So in my case, I just needed to install Authlib in my environment. Sorry for the run around.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.