From 37f71b7fe0c35fe9b35619449b9050cfd0e8701c Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Sat, 22 Feb 2025 22:20:01 +0100 Subject: [PATCH] auth: mech-oauth2 - Send openid-configuration result field only when available --- src/auth/mech-oauth2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/auth/mech-oauth2.c b/src/auth/mech-oauth2.c index e2dc2dd3d0..f35508331c 100644 --- a/src/auth/mech-oauth2.c +++ b/src/auth/mech-oauth2.c @@ -70,7 +70,10 @@ oauth2_fail(struct oauth2_auth_request *oauth2_req, const char *status) json_ostream_nwrite_string(joutput, "status", status); } json_ostream_nwrite_string(joutput, "scope", "mail"); - json_ostream_nwrite_string(joutput, "openid-configuration", oidc_url); + if (*oidc_url != '\0') { + json_ostream_nwrite_string( + joutput, "openid-configuration", oidc_url); + } json_ostream_nascend_object(joutput); json_ostream_nfinish_destroy(&joutput); -- 2.47.3