web/admin: fix not being able to unset certificates (#6767)

* web: fix 6742: empty web certificate request needs to return null, not undefined

This replaces the `undefined` setting of the certificate search wrapper to
`null` when the admin requests no certificate.

* only set singleton if we don't have an instance

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Ken Sternberg 2023-09-05 15:37:49 -07:00 committed by Jens Langhammer
parent ae91689fd8
commit 25ac04f4e5
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ export class AkCryptoCertificateSearch extends CustomListenerElement(AKElement)
}
get value() {
return this.selectedKeypair ? renderValue(this.selectedKeypair) : undefined;
return this.selectedKeypair ? renderValue(this.selectedKeypair) : null;
}
connectedCallback() {

View File

@ -205,8 +205,8 @@ ${this.instance?.redirectUris}</textarea
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${msg("Signing Key")} name="signingKey">
<ak-crypto-certificate-search
certificate=${this.instance?.signingKey}
singleton
certificate=${ifDefined(this.instance?.signingKey || "")}
?singleton=${!this.instance}
></ak-crypto-certificate-search>
<p class="pf-c-form__helper-text">${msg("Key used to sign the tokens.")}</p>
</ak-form-element-horizontal>