From abe3f73cb6a029ce37ab280be89e7c6acb93f4a7 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 9 Aug 2022 18:36:35 +0300 Subject: [PATCH] SSO: auto set checkboxes --- packages/client/src/store/SsoFormStore.js | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/client/src/store/SsoFormStore.js b/packages/client/src/store/SsoFormStore.js index e3575e1549..658f1a920e 100644 --- a/packages/client/src/store/SsoFormStore.js +++ b/packages/client/src/store/SsoFormStore.js @@ -601,6 +601,7 @@ class SsoFormStore { const newCertificates = res.data; newCertificates.map((cert) => { this.spCertificates = [...this.spCertificates, cert]; + this.checkedSpBoxes(cert); }); this.isCertificateLoading = false; this.closeSpModal(); @@ -611,6 +612,21 @@ class SsoFormStore { } }; + checkedSpBoxes = (cert) => { + if (cert.action === "signing") { + this.spSignAuthRequests = true; + this.spSignLogoutRequests = true; + } + if (cert.action === "encrypt") { + this.spEncryptAssertions = true; + } + if (cert.action === "signing and encrypt") { + this.spSignAuthRequests = true; + this.spSignLogoutRequests = true; + this.spEncryptAssertions = true; + } + }; + addIdpCertificate = async (t) => { const data = [ { @@ -636,6 +652,7 @@ class SsoFormStore { const newCertificates = res.data; newCertificates.map((cert) => { this.idpCertificates = [...this.idpCertificates, cert]; + this.checkedIdpBoxes(cert); }); this.isCertificateLoading = false; this.closeIdpModal(); @@ -646,6 +663,21 @@ class SsoFormStore { } }; + checkedIdpBoxes = (cert) => { + if (cert.action === "verification") { + this.idpVerifyAuthResponsesSign = true; + this.idpVerifyLogoutRequestsSign = true; + } + if (cert.action === "decrypt") { + this.idpVerifyLogoutResponsesSign = true; + } + if (cert.action === "verification and decrypt") { + this.idpVerifyAuthResponsesSign = true; + this.idpVerifyLogoutRequestsSign = true; + this.idpVerifyLogoutResponsesSign = true; + } + }; + setGeneratedCertificate = (certificateObject) => { this.spCertificate = certificateObject.crt; this.spPrivateKey = certificateObject.key;