Skip to content

Commit 07c4e9a

Browse files
committed
fix(api): service keys
1 parent 2b02edd commit 07c4e9a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = async client => {
8585
statusCode: 451,
8686
});
8787
}
88-
if (!req.user.scopes?.includes('applications.commands.permissions.update')) {
88+
if (!req.user.service && !req.user.scopes?.includes('applications.commands.permissions.update')) {
8989
return res.code(401).send({
9090
elevate: 'admin',
9191
error: 'Unauthorised',

src/routes/api/users/@me/key.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports.get = fastify => ({
1111
token: this.jwt.sign({
1212
createdAt: Date.now(),
1313
id: req.user.id,
14+
service: true,
1415
}),
1516
};
1617
}

0 commit comments

Comments
 (0)