mirror of
https://github.com/documenso/documenso.git
synced 2026-09-29 16:24:30 +10:00
`/api/health` and `/api/certificate-status` reported the cert as available when `NEXT_PRIVATE_SIGNING_TRANSPORT` was unset, even though sealing defaults to the local P12 and fails if it is missing, unreadable, or expired.
21 lines
469 B
TypeScript
21 lines
469 B
TypeScript
import { getCertificateStatus } from '@documenso/lib/server-only/cert/cert-status';
|
|
|
|
export const loader = async () => {
|
|
try {
|
|
const certStatus = await getCertificateStatus();
|
|
|
|
return Response.json({
|
|
isAvailable: certStatus.isAvailable,
|
|
timestamp: new Date().toISOString(),
|
|
});
|
|
} catch {
|
|
return Response.json(
|
|
{
|
|
isAvailable: false,
|
|
timestamp: new Date().toISOString(),
|
|
},
|
|
{ status: 500 },
|
|
);
|
|
}
|
|
};
|