From: Stephan Bosch Date: Sat, 22 Feb 2025 21:20:01 +0000 (+0100) Subject: auth: mech-oauth2 - Send openid-configuration result field only when available X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37f71b7fe0c35fe9b35619449b9050cfd0e8701c;p=thirdparty%2Fdovecot%2Fcore.git auth: mech-oauth2 - Send openid-configuration result field only when available --- 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);