SSO: auto set checkboxes

This commit is contained in:
Viktor Fomin 2022-08-09 18:36:35 +03:00
parent 75a7553397
commit abe3f73cb6

View File

@ -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;