And another one

This commit is contained in:
Shadowfacts 2019-09-18 08:30:58 -04:00
parent b8346c7a19
commit 10a90ea48f
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@ export = async (req: Request, res: Response, next: NextFunction) => {
console.log(`Could not retrieve actor ${req.body.actor} to validate HTTP signature for`, req.body);
res.status(401).end("Could not retrieve actor to validate HTTP signature");
}
} else if (!actor.publicKey) {
console.log(`Could not validate HTTP signature, actor missing public key: ${actor}`);
res.status(401).end("Actor missing public key.")
} else if (!validate(req, actor.publicKey.publicKeyPem)) {
console.log(`Could not validate HTTP signature for ${req.body.actor}`);
res.status(401).end("Could not validate HTTP signature");