@@ -578,14 +578,18 @@ def refresh(self) -> None:
578578 """
579579 Refreshes the acccess token using the stored refresh token.
580580 """
581- response = self .sync_client .post (
581+ request = self .sync_client .build_request (
582+ "POST" ,
582583 "/oauth/token" ,
583584 json = {
584585 "grant_type" : "refresh_token" ,
585586 "client_secret" : self .provider_secret ,
586587 "refresh_token" : self .refresh_token ,
587588 },
588589 )
590+ # Don't send the Authorization header for this request
591+ request .headers .pop ("Authorization" , None )
592+ response = self .sync_client .send (request )
589593 validate_response (response )
590594 data = response .json ()
591595 # update the relevant tokens
@@ -602,14 +606,18 @@ async def a_refresh(self) -> None:
602606 """
603607 Refreshes the acccess token using the stored refresh token.
604608 """
605- response = await self .async_client .post (
609+ request = self .async_client .build_request (
610+ "POST" ,
606611 "/oauth/token" ,
607612 json = {
608613 "grant_type" : "refresh_token" ,
609614 "client_secret" : self .provider_secret ,
610615 "refresh_token" : self .refresh_token ,
611616 },
612617 )
618+ # Don't send the Authorization header for this request
619+ request .headers .pop ("Authorization" , None )
620+ response = await self .async_client .send (request )
613621 validate_response (response )
614622 data = response .json ()
615623 # update the relevant tokens
0 commit comments