Spaces:
Sleeping
Sleeping
app.py
CHANGED
|
@@ -177,7 +177,9 @@ def main():
|
|
| 177 |
# Function to handle OAuth callback
|
| 178 |
def handle_callback():
|
| 179 |
flow = create_flow()
|
| 180 |
-
|
|
|
|
|
|
|
| 181 |
credentials = flow.credentials
|
| 182 |
st.session_state['credentials'] = credentials.to_json()
|
| 183 |
return credentials
|
|
|
|
| 177 |
# Function to handle OAuth callback
|
| 178 |
def handle_callback():
|
| 179 |
flow = create_flow()
|
| 180 |
+
code = st.experimental_get_query_params().get("code", [None])[0]
|
| 181 |
+
if code:
|
| 182 |
+
flow.fetch_token(code=code)
|
| 183 |
credentials = flow.credentials
|
| 184 |
st.session_state['credentials'] = credentials.to_json()
|
| 185 |
return credentials
|