diff --git a/src/http.js b/src/http.js index 33f8e53..735a606 100644 --- a/src/http.js +++ b/src/http.js @@ -85,7 +85,7 @@ module.exports = async client => { statusCode: 451, }); } - if (!req.user.scopes?.includes('applications.commands.permissions.update')) { + if (!req.user.service && !req.user.scopes?.includes('applications.commands.permissions.update')) { return res.code(401).send({ elevate: 'admin', error: 'Unauthorised', diff --git a/src/routes/api/users/@me/key.js b/src/routes/api/users/@me/key.js index 7d8b202..834d279 100644 --- a/src/routes/api/users/@me/key.js +++ b/src/routes/api/users/@me/key.js @@ -11,6 +11,7 @@ module.exports.get = fastify => ({ token: this.jwt.sign({ createdAt: Date.now(), id: req.user.id, + service: true, }), }; }