Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,8 @@ import urllib.parse
|
|
| 3 |
from fastapi import FastAPI, HTTPException
|
| 4 |
from fastapi.responses import HTMLResponse, RedirectResponse
|
| 5 |
import requests
|
|
|
|
|
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
|
@@ -56,7 +58,8 @@ async def oauth_callback(code: str = None):
|
|
| 56 |
}
|
| 57 |
headers = {"Content-Type": "application/x-www-form-urlencoded"}
|
| 58 |
|
| 59 |
-
|
|
|
|
| 60 |
token_data = token_res.json()
|
| 61 |
|
| 62 |
if "access_token" not in token_data:
|
|
|
|
| 3 |
from fastapi import FastAPI, HTTPException
|
| 4 |
from fastapi.responses import HTMLResponse, RedirectResponse
|
| 5 |
import requests
|
| 6 |
+
import urllib3
|
| 7 |
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
|
|
| 58 |
}
|
| 59 |
headers = {"Content-Type": "application/x-www-form-urlencoded"}
|
| 60 |
|
| 61 |
+
# Füge 'verify=False' am Ende hinzu, um den SSL-Handshake-Absturz zu umgehen
|
| 62 |
+
token_res = requests.post(token_url, data=data, headers=headers, verify=False)
|
| 63 |
token_data = token_res.json()
|
| 64 |
|
| 65 |
if "access_token" not in token_data:
|