]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: mech-oauth2 - Send openid-configuration result field only when available
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 22 Feb 2025 21:20:01 +0000 (22:20 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 2 Sep 2025 05:25:53 +0000 (05:25 +0000)
src/auth/mech-oauth2.c

index e2dc2dd3d0907bf5e746f370744d8f378c5291dc..f35508331cd97c58bc0e2e186fc93c6b60f2ef42 100644 (file)
@@ -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);