We should make sure the key pair is available.

This commit is contained in:
Andrew Pietila 2023-03-29 23:44:26 -05:00
parent 031eba7936
commit 552fc41c5e

View file

@ -8,7 +8,7 @@ module.exports = {
* @param {express.IRoute} routeObj
*/
route: (routeObj) => {
routeObj.get((req, res, _next) => {
routeObj.get(async (req, res, _next) => {
res.setHeader('content-type', 'application/activity+json');
res.json({
'@context': [
@ -25,7 +25,7 @@ module.exports = {
'security:owner': {
id: `https://${req.hostname}/actor`
},
'security:publicKeyPem': getKeyPair(`https://${req.hostname}/actor`)["publicKey"]
'security:publicKeyPem': (await getKeyPair(`https://${req.hostname}/actor`))["publicKey"]
},
'endpoints': {
sharedInbox: `https://${req.hostname}/inbox`