hummingbot / dashboard

Application that helps you create, backtest, deploy, and manage Hummingbot instances
Apache License 2.0
175 stars 115 forks source link

Dashboard doesn't remember auth session upon reload of main page #83

Open fengtality opened 11 months ago

fengtality commented 11 months ago

Describe the bug

After logging in, if the user reloads page when on http://localhost:8501/, they have to log in again.

I think this is because the Authenticate function in main.py takes a while, while the auth check that happens afterwards occurs before the variable is initialized.

st.session_state.authenticator = Authenticate(
    config['credentials'],
    config['cookie']['name'],
    config['cookie']['key'],
    config['cookie']['expiry_days'],
    config['preauthorized']
)

if st.session_state["authentication_status"]:
    config["credentials"] = st.session_state.authenticator.credentials

Steps to reproduce bug