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 GitHub
parent bbdf8c054b
commit 0a9880547c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>