Login and Logout through Hydralit!
AravindRK99 opened this issue · 1 comments
Hi there! I have recently discovered hydralit and I love the library so far. I am trying to built a login page that will redirect me to the page with multiple applications. In the hydralit example, I had noticed that there is a feature for Logout available which will redirect the user back to the login page.
My code for the Login page is as follows:
class LoginApp(HydraHeadApp):
def run(self):
c1, c2, c3 = st.columns(3)
c1.write(" ")
with c2:
st.title("Login")
if st.button('Guest Login', key='guestbtn'):
st.success(f"✔️ Login success")
with st.spinner("🤓 now redirecting to application...."):
time.sleep(1)
self.set_access(1, 'guest')
self.do_redirect()
c3.write(" ")
The page gets redirected to my home page but there is an additional tab next to the home page with the title "Login" and there's an error:
😭 Error triggered from app: Logout
Details: ‘Logout’
Am I missing something out here? Do I have to include additional code anywhere?
i suggest you read the home page and study the example repo, as the entire solution works just fine when used correctly, the home and logout options are added automatically when running a secure app, so no need to specifically add them.