Skip to content

Commit

Permalink
add token to state
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 13, 2024
1 parent ec46a4e commit 3db7b23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ def get_user():
and st.query_params["token"] != "None"
):
set_cookie("token", st.query_params["token"], 1)
token = str(st.query_params["token"])
st.session_state["token"] = str(st.query_params["token"])
st.query_params["token"] = ""
else:
token = get_cookie("token")
st.session_state["token"] = get_cookie("token")
token = st.session_state["token"] if "token" in st.session_state else ""
if token != "" and token is not None and token != "None":
user_request = requests.get(
f"{auth_uri}/v1/user",
Expand Down

0 comments on commit 3db7b23

Please sign in to comment.