Kunal commited on
Commit ·
dd5aacd
1
Parent(s): 6c434ae
update auth.py for deployment
Browse files- src/auth.py +3 -3
src/auth.py
CHANGED
|
@@ -36,12 +36,12 @@ class MALAuth:
|
|
| 36 |
st.markdown(f"[Click here to authenticate with MyAnimeList]({auth_url})", unsafe_allow_html=True)
|
| 37 |
|
| 38 |
# Streamlit Community Cloud: handle redirect via query params
|
| 39 |
-
query_params = st.
|
| 40 |
if "code" in query_params:
|
| 41 |
-
self.auth_code = query_params["code"][0]
|
| 42 |
return self.auth_code, None
|
| 43 |
elif "error" in query_params:
|
| 44 |
-
self.error = query_params["error"][0]
|
| 45 |
return None, self.error
|
| 46 |
|
| 47 |
# Local: try to run a local HTTP server if running on localhost
|
|
|
|
| 36 |
st.markdown(f"[Click here to authenticate with MyAnimeList]({auth_url})", unsafe_allow_html=True)
|
| 37 |
|
| 38 |
# Streamlit Community Cloud: handle redirect via query params
|
| 39 |
+
query_params = st.query_params
|
| 40 |
if "code" in query_params:
|
| 41 |
+
self.auth_code = query_params["code"][0] if isinstance(query_params["code"], list) else query_params["code"]
|
| 42 |
return self.auth_code, None
|
| 43 |
elif "error" in query_params:
|
| 44 |
+
self.error = query_params["error"][0] if isinstance(query_params["error"], list) else query_params["error"]
|
| 45 |
return None, self.error
|
| 46 |
|
| 47 |
# Local: try to run a local HTTP server if running on localhost
|