Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 13, 2024
1 parent 01287ea commit dd2244f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def getenv(var_name: str):
"ENCRYPTION_SECRET": "it-is-a-secret-to-everybody",
"APP_NAME": "Magical Auth",
"AUTH_PROVIDER": "magicalauth",
"MAGIC_LINK_URL": "https://localhost:8507/",
"MAGIC_LINK_URL": "https://localhost:8519",
"LOG_LEVEL": "INFO",
"LOG_FORMAT": "%(asctime)s | %(levelname)s | %(message)s",
"UVICORN_WORKERS": 1,
Expand Down
6 changes: 4 additions & 2 deletions components/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def google_sso_button():
)
if "code" in st.query_params:
if st.query_params["code"] != "":
code = st.query_params["code"]
code = str(st.query_params["code"])
logging.info(f"Saving code: {code}")
# save the code in the cookie
set_cookie("code", code, 1, "set_code_cookie")
# Clear code from URL
Expand All @@ -62,6 +63,7 @@ def google_sso_button():
# Get cookie of "code", if it exists
code = get_cookie("code", "get_code_cookie")
if code != "" and code is not None:
logging.info(f"Referencing code: {code}")
response = requests.post(
f"{auth_uri}/v1/oauth2/google",
json={
Expand All @@ -72,7 +74,7 @@ def google_sso_button():
res = response.json()
if "detail" in res:
details = res["detail"]
logging.info(f"Google SSO: {details}")
logging.info(f"Google SSO Detail: {details}")
if str(details).startswith("http"):
set_cookie("code", "", 1, "clear_code_cookie")
# Go to the login link
Expand Down

0 comments on commit dd2244f

Please sign in to comment.