From 0dfe3d763d5017875fd86ff3517881aa8a3a4544 Mon Sep 17 00:00:00 2001 From: Ty Date: Mon, 11 Mar 2024 19:38:13 -0600 Subject: [PATCH] Fix AP implementation --- src/routes/main.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/routes/main.js b/src/routes/main.js index 6e9f988..eeb8306 100644 --- a/src/routes/main.js +++ b/src/routes/main.js @@ -55,6 +55,14 @@ router.get('/.well-known/webfinger', (req, res) => { return } + if (!req.query.resource) { + res.status(400).send(); + return + } else if (req.query.resource != "acct:keyoxide@keyoxide.org") { + res.status(404).send(); + return + } + const body = { subject: `acct:keyoxide@${process.env.DOMAIN}`, aliases: [`https://${process.env.DOMAIN}/users/keyoxide`], @@ -87,7 +95,7 @@ router.get('/users/keyoxide', (req, res) => { id: `https://${process.env.DOMAIN}/users/keyoxide`, type: 'Application', inbox: `https://${process.env.DOMAIN}/users/keyoxide/inbox`, - preferredUsername: `${process.env.DOMAIN}`, + preferredUsername: 'keyoxide', publicKey: { id: `https://${process.env.DOMAIN}/users/keyoxide#main-key`, owner: `https://${process.env.DOMAIN}/users/keyoxide`,