fix(oauth): correct parameter names (code_autorisation, not code)
Qobuz redirects to play.qobuz.com/discover?code_autorisation=XXX not ?code=XXX. Both the navigation intercept and the /oauth/callback API call were using the wrong parameter name, so the code was never captured and the exchange request was malformed.
This commit is contained in:
3 files changed
+4
-4
No files matched your search
@@ -210,7 +210,7 @@ impl QobuzClient {
|
|||||||
.http
|
.http
|
||||||
.get(&callback_url)
|
.get(&callback_url)
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
.query(&[("code", code), ("private_key", &private_key)])
|
.query(&[("code_autorisation", code), ("private_key", &private_key)])
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ impl QobuzClient {
|
|||||||
.http
|
.http
|
||||||
.get(&callback_url)
|
.get(&callback_url)
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
.query(&[("code", code), ("private_key", &private_key)])
|
.query(&[("code_autorisation", code), ("private_key", &private_key)])
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
@@ -1078,10 +1078,10 @@ pub async fn v2_start_oauth_login(
|
|||||||
.resizable(true)
|
.resizable(true)
|
||||||
.on_navigation(move |url| {
|
.on_navigation(move |url| {
|
||||||
log::info!("[OAuth] on_navigation: {}", url);
|
log::info!("[OAuth] on_navigation: {}", url);
|
||||||
// Intercept redirect to play.qobuz.com/discover?code=...
|
// Intercept redirect to play.qobuz.com/discover?code_autorisation=...
|
||||||
if url.host_str() == Some("play.qobuz.com") {
|
if url.host_str() == Some("play.qobuz.com") {
|
||||||
for (key, value) in url.query_pairs() {
|
for (key, value) in url.query_pairs() {
|
||||||
if key == "code" {
|
if key == "code_autorisation" || key == "code" {
|
||||||
let mut holder = code_holder_nav.lock().unwrap();
|
let mut holder = code_holder_nav.lock().unwrap();
|
||||||
// Only act on the first code (idempotent)
|
// Only act on the first code (idempotent)
|
||||||
if holder.is_none() {
|
if holder.is_none() {
|
||||||
|
|||||||
Reference in new issue
Block a user