misc: addressed CA status issue

This commit is contained in:
Sheen Capadngan
2025-05-22 20:04:21 +08:00
parent df75b3b8d3
commit 8ff95aedd5
2 changed files with 3 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ export const InternalCertificateAuthorityFns = ({
subscriber: TPkiSubscribers,
ca: Awaited<ReturnType<TCertificateAuthorityDALFactory["findByIdWithAssociatedCa"]>>
) => {
if (ca.internalCa?.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
if (ca.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
if (!ca.internalCa?.activeCaCertId)
throw new BadRequestError({ message: "CA does not have a certificate installed" });

View File

@@ -326,7 +326,7 @@ export const pkiSubscriberServiceFactory = ({
throw new BadRequestError({ message: "CA does not support ordering of certificates" });
}
if (ca.externalCa?.status !== CaStatus.ACTIVE) {
if (ca.status !== CaStatus.ACTIVE) {
throw new BadRequestError({ message: "CA is disabled" });
}
@@ -423,7 +423,7 @@ export const pkiSubscriberServiceFactory = ({
if (subscriber.status !== PkiSubscriberStatus.ACTIVE)
throw new BadRequestError({ message: "Subscriber is not active" });
if (ca.internalCa?.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
if (ca.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
if (!ca.internalCa?.activeCaCertId)
throw new BadRequestError({ message: "CA does not have a certificate installed" });