Skip to content

Commit

Permalink
set cookie then refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 13, 2024
1 parent aaba0e0 commit 75c12d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ def google_sso_button():
if "detail" in res:
details = res["detail"]
logging.info(f"Google SSO: {details}")
if details.startswith("http"):
if str(details).startswith("http"):
# Token is in the url ?token= to end of url
token = str(details).split("?token=")[1]
set_cookie("token", token, 1, "google_sso_token")
# Redirect to the login link
st.markdown(
f'<meta http-equiv="refresh" content="0;URL={details}">',
unsafe_allow_html=True,
)
st.rerun()
else:
st.error(details)
logging.error(f"Error with Google SSO: {details}")
Expand Down

0 comments on commit 75c12d8

Please sign in to comment.