This commit is contained in:
parent
778db17e46
commit
ca9375a779
@ -1,4 +1,6 @@
|
|||||||
import httpx
|
import httpx
|
||||||
|
import ssl
|
||||||
|
import certifi
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
import models
|
import models
|
||||||
@ -86,7 +88,8 @@ async def import_contacts_from_google(
|
|||||||
|
|
||||||
imported_count = 0
|
imported_count = 0
|
||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
|
||||||
|
async with httpx.AsyncClient(verify=ssl_ctx) as client:
|
||||||
response = await client.get(url, headers=headers, params=params)
|
response = await client.get(url, headers=headers, params=params)
|
||||||
|
|
||||||
logger.info(f"Google API response status: {response.status_code}")
|
logger.info(f"Google API response status: {response.status_code}")
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import shutil
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
import httpx
|
import httpx
|
||||||
|
import ssl
|
||||||
|
import certifi
|
||||||
from urllib.parse import urlencode, quote
|
from urllib.parse import urlencode, quote
|
||||||
from datetime import timezone, timedelta
|
from datetime import timezone, timedelta
|
||||||
|
|
||||||
@ -1077,7 +1079,8 @@ async def google_callback(
|
|||||||
raise HTTPException(status_code=500, detail="Google OAuth credentials not configured")
|
raise HTTPException(status_code=500, detail="Google OAuth credentials not configured")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient() as client_http:
|
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
|
||||||
|
async with httpx.AsyncClient(verify=ssl_ctx) as client_http:
|
||||||
# Exchange authorization code for access token
|
# Exchange authorization code for access token
|
||||||
token_url = "https://oauth2.googleapis.com/token"
|
token_url = "https://oauth2.googleapis.com/token"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user