Spaces:
Paused
Paused
updated app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,8 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|
21 |
if self.path.startswith("/callback"):
|
22 |
# Capture the authorization code
|
23 |
code = self.path.split("code=")[1]
|
|
|
|
|
24 |
response = requests.post(TOKEN_URL, data={
|
25 |
'client_id': CLIENT_ID,
|
26 |
'client_secret': CLIENT_SECRET,
|
@@ -29,6 +31,8 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|
29 |
'redirect_uri': REDIRECT_URI
|
30 |
})
|
31 |
token_data = response.json()
|
|
|
|
|
32 |
access_token = token_data.get('access_token')
|
33 |
self.send_response(200)
|
34 |
self.end_headers()
|
|
|
21 |
if self.path.startswith("/callback"):
|
22 |
# Capture the authorization code
|
23 |
code = self.path.split("code=")[1]
|
24 |
+
print("Authorization code received:", code)
|
25 |
+
|
26 |
response = requests.post(TOKEN_URL, data={
|
27 |
'client_id': CLIENT_ID,
|
28 |
'client_secret': CLIENT_SECRET,
|
|
|
31 |
'redirect_uri': REDIRECT_URI
|
32 |
})
|
33 |
token_data = response.json()
|
34 |
+
print("Token response:", response.json())
|
35 |
+
print("Token data:", token_data)
|
36 |
access_token = token_data.get('access_token')
|
37 |
self.send_response(200)
|
38 |
self.end_headers()
|