debug(oauth): log response body on /oauth/callback failure, add app_id query param

This commit is contained in:
vicrodh committed 2026-02-23 15:22:06 -06:00
1 parent 22060d1d35
commit 674990ebe5
1 file changed
+15 -4
+15 -4
View File
@@ -206,19 +206,30 @@ impl QobuzClient {
HeaderValue::from_str(&app_id).map_err(|_| ApiError::InvalidAppId)?,
);
log::info!("[OAuth] Exchanging code at /oauth/callback");
log::info!(
"[OAuth] Exchanging code at /oauth/callback (app_id={}, key={})",
app_id,
private_key
);
let resp = self
.http
.get(&callback_url)
.headers(headers)
.query(&[("code_autorisation", code), ("private_key", &private_key)])
.query(&[
("code_autorisation", code),
("private_key", &private_key),
("app_id", &app_id),
])
.send()
.await?;
if !resp.status().is_success() {
let status = resp.status();
let body = resp.text().await.unwrap_or_default();
log::error!("[OAuth] /oauth/callback failed {}: {}", status, body);
return Err(ApiError::ApiResponse(format!(
"OAuth callback failed: {}",
resp.status()
"OAuth callback failed: {} — {}",
status, body
)));
}