From 147e227fa087ef59e205e3f06bb25ef900d2f5b0 Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 28 Sep 2025 20:53:42 +0300 Subject: [PATCH] oauth-google --- auth/oauth.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth/oauth.py b/auth/oauth.py index 413fab28..1837ed4b 100644 --- a/auth/oauth.py +++ b/auth/oauth.py @@ -769,6 +769,10 @@ async def oauth_callback_http(request: Request) -> JSONResponse | RedirectRespon "code_verifier": code_verifier, } + # Google требует client_secret даже при использовании PKCE + if hasattr(client, "client_secret") and client.client_secret: + token_data["client_secret"] = client.client_secret + async with httpx.AsyncClient() as http_client: response = await http_client.post( token_endpoint, data=token_data, headers={"Accept": "application/json"}