SSO: fix exist certificate

This commit is contained in:
Viktor Fomin 2022-08-08 13:55:38 +03:00
parent b252732ed2
commit e6651821ce
3 changed files with 14 additions and 4 deletions

View File

@ -46,7 +46,7 @@ const AddIdpCertificateModal = (props) => {
<ModalDialog.Footer> <ModalDialog.Footer>
<Button <Button
label={t("Common:OKButton")} label={t("Common:OKButton")}
onClick={addIdpCertificate} onClick={() => addIdpCertificate(t)}
primary primary
scale scale
isLoading={isCertificateLoading} isLoading={isCertificateLoading}

View File

@ -81,7 +81,7 @@ const AddSpCertificateModal = (props) => {
<ModalDialog.Footer> <ModalDialog.Footer>
<Button <Button
label={t("Common:OKButton")} label={t("Common:OKButton")}
onClick={addSpCertificate} onClick={() => addSpCertificate(t)}
primary primary
size="normalTouchscreen" size="normalTouchscreen"
isLoading={isCertificateLoading} isLoading={isCertificateLoading}

View File

@ -576,7 +576,7 @@ class SsoFormStore {
); );
}; };
addSpCertificate = async () => { addSpCertificate = async (t) => {
const data = [ const data = [
{ {
crt: this.spCertificate, crt: this.spCertificate,
@ -585,6 +585,11 @@ class SsoFormStore {
}, },
]; ];
if (this.spCertificates.find((item) => item.action === this.spAction)) {
toastr.error(t("CertificateExist"));
return;
}
this.isCertificateLoading = true; this.isCertificateLoading = true;
try { try {
@ -606,7 +611,7 @@ class SsoFormStore {
} }
}; };
addIdpCertificate = async () => { addIdpCertificate = async (t) => {
const data = [ const data = [
{ {
crt: this.idpCertificate, crt: this.idpCertificate,
@ -615,6 +620,11 @@ class SsoFormStore {
}, },
]; ];
if (this.idpCertificates.find((item) => item.crt === this.idpCertificate)) {
toastr.error(t("CertificateExist"));
return;
}
this.isCertificateLoading = true; this.isCertificateLoading = true;
try { try {