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>
<Button
label={t("Common:OKButton")}
onClick={addIdpCertificate}
onClick={() => addIdpCertificate(t)}
primary
scale
isLoading={isCertificateLoading}

View File

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

View File

@ -576,7 +576,7 @@ class SsoFormStore {
);
};
addSpCertificate = async () => {
addSpCertificate = async (t) => {
const data = [
{
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;
try {
@ -606,7 +611,7 @@ class SsoFormStore {
}
};
addIdpCertificate = async () => {
addIdpCertificate = async (t) => {
const data = [
{
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;
try {