Fix status handling

This commit is contained in:
Fang-Pen Lin
2025-10-31 16:47:20 -07:00
parent 8aa7594f03
commit 453dc57829
2 changed files with 3 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ export const pkiAcmeChallengeDALFactory = (db: TDbClient) => {
try {
const [challenge] = (await (tx || db)(TableName.PkiAcmeChallenge)
.where({ id })
.update({ status: AcmeChallengeStatus.Valid, validatedAt: new Date() })
.update({ status: AcmeChallengeStatus.Invalid })
.returning("*")) as [TPkiAcmeChallenges];
// Update pending auth to valid as well

View File

@@ -251,7 +251,8 @@ export const fastifyErrHandler = fastifyPlugin(async (server: FastifyZodProvider
reqId: req.id,
status: error.status,
type: `urn:ietf:params:acme:error:${error.type}`,
detail: error.detail
detail: error.detail,
message: error.message
// TODO: add subproblems if they exist
});
} else {