Skip to content

Commit

Permalink
more state things
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 13, 2024
1 parent fa6d760 commit d23ec5a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,18 @@ def google_sso_button():
data = response.json()
if "detail" in data:
new_uri = data["detail"]
st.write(f"Redirecting to: {new_uri}")
st.write(f"Redirecting to: {new_uri}") # Debug message
st.session_state["oauth2_token_completed"] = True
st.session_state["oauth2_token_requested"] = False
st.markdown(
f'<meta http-equiv="refresh" content="0;URL={new_uri}">',
unsafe_allow_html=True,
)
st.session_state["oauth2_token_completed"] = True
st.stop() # Ensure the script stops after redirection
else:
st.session_state["oauth2_token_requested"] = False

st.error("Unexpected response structure from backend.")
st.stop()
else:
st.session_state["oauth2_token_requested"] = False
st.error(response.json()["detail"])
Expand Down

0 comments on commit d23ec5a

Please sign in to comment.