Skip to content

Commit 7fb7f14

Browse files
authored
fix: do not pass params twice to token request (#147)
1 parent 6a311f4 commit 7fb7f14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fastapi_sso/sso/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ async def process_login(
472472

473473
current_path = f"{url.scheme}://{url.netloc}{url.path}"
474474

475+
if pkce_code_verifier:
476+
params.update({"code_verifier": pkce_code_verifier})
477+
475478
token_url, headers, body = self.oauth_client.prepare_token_request(
476479
await self.token_endpoint,
477480
authorization_response=current_url,
@@ -487,11 +490,8 @@ async def process_login(
487490

488491
auth = httpx.BasicAuth(self.client_id, self.client_secret)
489492

490-
if pkce_code_verifier:
491-
params.update({"code_verifier": pkce_code_verifier})
492-
493493
async with httpx.AsyncClient() as session:
494-
response = await session.post(token_url, headers=headers, content=body, auth=auth, params=params)
494+
response = await session.post(token_url, headers=headers, content=body, auth=auth)
495495
content = response.json()
496496
self._refresh_token = content.get("refresh_token")
497497
self._id_token = content.get("id_token")

0 commit comments

Comments
 (0)