Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 13, 2024
1 parent 1108bbb commit afcded4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions components/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ def google_sso_button():
if "code" in st.query_params:
if st.query_params["code"] != "":
code = str(st.query_params["code"])
logging.info(f"Saving code: {code}")
st.query_params["code"] = ""
st.query_params["scope"] = ""
st.query_params["state"] = ""
st.query_params["authuser"] = ""
st.query_params["prompt"] = ""
logging.info(f"Referencing code: {code}")
logging.info(f"Setting code: {code}")
response = requests.post(
f"{auth_uri}/v1/oauth2/google",
json={
Expand All @@ -64,9 +58,10 @@ def google_sso_button():
)
res = response.json()
if "detail" in res:
details = res["detail"]
details = str(res["detail"])
logging.info(f"Google SSO Detail: {details}")
if str(details).startswith("http"):
if details.startswith("http"):
logging.info(f"Redirecting to: {details}")
# Go to the login link
st.markdown(
f'<meta http-equiv="refresh" content="0;URL={details}">',
Expand Down

0 comments on commit afcded4

Please sign in to comment.