Skip to content

Commit 8a0fc0a

Browse files
authored
fix: subs all certs fields required (#5891)
* fix: all three certs fields are requried * fix: lint
1 parent bf93bde commit 8a0fc0a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/writeData/subscriptions/components/CertificateInput.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const NewCertificateInput: FC<OwnProps> = ({updateForm, subscription}) => {
8383
placeholder={CertificatePlaceholders.clientKey}
8484
value={subscription?.brokerClientKey ?? ''}
8585
rows={4}
86+
required
8687
/>
8788
<TextAreaWithLabel
8889
name="CertificateAuthority"
@@ -91,6 +92,7 @@ const NewCertificateInput: FC<OwnProps> = ({updateForm, subscription}) => {
9192
value={subscription?.brokerClientCert ?? ''}
9293
placeholder={CertificatePlaceholders.clientCert}
9394
rows={4}
95+
required
9496
/>
9597
</FlexBox>
9698
)

src/writeData/subscriptions/utils/form.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ const checkBasicSelected = (form: Subscription): boolean =>
248248
const checkCertificateRequiredFields = (form: Subscription): boolean =>
249249
form.authType === BrokerAuthTypes.Certificate &&
250250
!!form.brokerCACert &&
251-
// you either need to provide both or neither
252-
((!!form.brokerClientCert && !!form.brokerClientKey) ||
253-
(!form.brokerClientCert && !form.brokerClientKey))
251+
!!form.brokerClientCert &&
252+
!!form.brokerClientKey
254253

255254
const checkCreatingCertificate = (form: Subscription): boolean =>
256255
form.authType === BrokerAuthTypes.Certificate && !form.brokerCertCreationDate

0 commit comments

Comments
 (0)