Spaces:
Sleeping
Sleeping
Commit
·
1bbee3f
1
Parent(s):
bc52259
redirect
Browse files- app/routes/auth.py +9 -1
app/routes/auth.py
CHANGED
@@ -44,7 +44,15 @@ async def auth_callback(request: Request):
|
|
44 |
return HTMLResponse("<h1>Session state not found. Please /login again.</h1>", status_code=400)
|
45 |
|
46 |
flow = create_flow()
|
47 |
-
flow.fetch_token(authorization_response=str(request.url))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
# Get the credentials object
|
50 |
credentials = flow.credentials
|
|
|
44 |
return HTMLResponse("<h1>Session state not found. Please /login again.</h1>", status_code=400)
|
45 |
|
46 |
flow = create_flow()
|
47 |
+
# flow.fetch_token(authorization_response=str(request.url))
|
48 |
+
|
49 |
+
flow.redirect_uri = GOOGLE_REDIRECT_URI # optional, for clarity
|
50 |
+
|
51 |
+
# IMPORTANT: pass `redirect_uri` again here:
|
52 |
+
flow.fetch_token(
|
53 |
+
authorization_response=str(request.url),
|
54 |
+
redirect_uri=GOOGLE_REDIRECT_URI
|
55 |
+
)
|
56 |
|
57 |
# Get the credentials object
|
58 |
credentials = flow.credentials
|