fix/streamlit-auth-issue

This commit is contained in:
david-hummingbot
2024-01-25 23:13:35 +08:00
committed by GitHub
parent 2d8086c88e
commit 5058bb62b4

View File

@@ -110,17 +110,17 @@ elif st.session_state["authentication_status"]:
dump_dict_to_yaml(config, "credentials.yml")
with st.sidebar:
st.write(f'Welcome {st.session_state["name"]}!')
st.session_state.authenticator.logout('Logout', 'sidebar')
st.session_state.authenticator.logout(location='sidebar') # Updated logout call
main_page()
else:
show_pages([
Page("main.py", "Hummingbot Dashboard", "📊"),
])
name, authentication_status, username = st.session_state.authenticator.login('Login', 'main')
name, authentication_status, username = st.session_state.authenticator.login(location='main') # Updated login call
if st.session_state["authentication_status"] == False:
st.error('Username/password is incorrect')
elif st.session_state["authentication_status"] == None:
st.warning('Please enter your username and password')
st.write("---")
st.write("If you are pre-authorized, you can login with your pre-authorized mail!")
st.session_state.authenticator.register_user('Register', 'main')
st.session_state.authenticator.register_user(location='main') # Updated register user call