fix auth failed ux

main
Gustav von Zitzewitz 1 year ago
parent 2f24eb5e1c
commit d3cad04219

@ -67,7 +67,7 @@ def authenticate(openai_api_key, activeloop_token, activeloop_org_name):
if not (openai_api_key and activeloop_token and activeloop_org_name):
st.session_state["auth_ok"] = False
st.error("Credentials neither set nor stored", icon=PAGE_ICON)
st.stop()
return
try:
# Try to access openai and deeplake
with st.spinner("Authentifying..."):
@ -81,7 +81,7 @@ def authenticate(openai_api_key, activeloop_token, activeloop_org_name):
logger.error(f"Authentication failed with {e}")
st.session_state["auth_ok"] = False
st.error("Authentication failed", icon=PAGE_ICON)
st.stop()
return
# store credentials in the session state
st.session_state["auth_ok"] = True
st.session_state["openai_api_key"] = openai_api_key

Loading…
Cancel
Save