From 27e840ced146f615e399fcfeda2f27cfca2a4af5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 20 Dec 2022 08:49:23 +0100 Subject: [PATCH] improve error message for oauth --- backend/windmill-api/src/oauth2.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/windmill-api/src/oauth2.rs b/backend/windmill-api/src/oauth2.rs index 377c0111c4..17a58b9cf4 100644 --- a/backend/windmill-api/src/oauth2.rs +++ b/backend/windmill-api/src/oauth2.rs @@ -1042,9 +1042,14 @@ async fn http_get_user_info( token ); return Err(error::Error::BadConfig(format!( - "The user info endpoint responded with non 200: {}, {}", + "The user info endpoint responded with non 200: {}\n{}\n{}", res.status(), - res.text().await.unwrap_or_default() + res.headers() + .iter() + .map(|x| format!("{}: {}", x.0.as_str(), x.1.to_str().unwrap_or_default())) + .collect::>() + .join("\n"), + res.text().await.unwrap_or_default(), ))); } Ok(res