Spaces:
Running
Running
Update test.py
Browse files
test.py
CHANGED
@@ -51,7 +51,8 @@ async def auth_google(code: str):
|
|
51 |
# response = requests.post(token_url, data=data)
|
52 |
# access_token = response.json().get("access_token")
|
53 |
access_token_new = code
|
54 |
-
print(response.json())
|
|
|
55 |
user_info = requests.get("https://www.googleapis.com/oauth2/v1/userinfo", headers={"Authorization": f"Bearer {access_token_new}"})
|
56 |
jobs_query = "subject:New application:ios"
|
57 |
gmail_url = f"https://www.googleapis.com/gmail/v1/users/me/messages?q={jobs_query}&maxResults=110"
|
@@ -98,7 +99,7 @@ async def auth_google(code: str):
|
|
98 |
|
99 |
print(attachments)
|
100 |
print(len(attachments))
|
101 |
-
return user_info.json()
|
102 |
|
103 |
@app.get("/auth1/google")
|
104 |
async def auth_google(request: Request,code: str,state: str = None):
|
|
|
51 |
# response = requests.post(token_url, data=data)
|
52 |
# access_token = response.json().get("access_token")
|
53 |
access_token_new = code
|
54 |
+
# print(response.json())
|
55 |
+
print(access_token_new)
|
56 |
user_info = requests.get("https://www.googleapis.com/oauth2/v1/userinfo", headers={"Authorization": f"Bearer {access_token_new}"})
|
57 |
jobs_query = "subject:New application:ios"
|
58 |
gmail_url = f"https://www.googleapis.com/gmail/v1/users/me/messages?q={jobs_query}&maxResults=110"
|
|
|
99 |
|
100 |
print(attachments)
|
101 |
print(len(attachments))
|
102 |
+
# return user_info.json()
|
103 |
|
104 |
@app.get("/auth1/google")
|
105 |
async def auth_google(request: Request,code: str,state: str = None):
|