MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / exchange_oauth_code

Method exchange_oauth_code

claw-code/rust/crates/api/src/client.rs:233–251  ·  view source on GitHub ↗
(
        &self,
        config: &OAuthConfig,
        request: &OAuthTokenExchangeRequest,
    )

Source from the content-addressed store, hash-verified

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,

Callers 1

run_loginFunction · 0.80

Calls 2

expect_successFunction · 0.85
form_paramsMethod · 0.80

Tested by

no test coverage detected