(
&self,
config: &OAuthConfig,
request: &OAuthTokenExchangeRequest,
)
| 231 | } |
| 232 | |
| 233 | pub async fn exchange_oauth_code( |
| 234 | &self, |
| 235 | config: &OAuthConfig, |
| 236 | request: &OAuthTokenExchangeRequest, |
| 237 | ) -> Result<OAuthTokenSet, ApiError> { |
| 238 | let response = self |
| 239 | .http |
| 240 | .post(&config.token_url) |
| 241 | .header("content-type", "application/x-www-form-urlencoded") |
| 242 | .form(&request.form_params()) |
| 243 | .send() |
| 244 | .await |
| 245 | .map_err(ApiError::from)?; |
| 246 | let response = expect_success(response).await?; |
| 247 | response |
| 248 | .json::<OAuthTokenSet>() |
| 249 | .await |
| 250 | .map_err(ApiError::from) |
| 251 | } |
| 252 | |
| 253 | pub async fn refresh_oauth_token( |
| 254 | &self, |
no test coverage detected