prevent put /guilds/id/members/id for others until we have oauth2 scopes impled
This commit is contained in:
parent
8a7ee8c8a9
commit
3498ffdc01
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
|
DiscordApiErrors,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
Emoji,
|
Emoji,
|
||||||
getPermission,
|
getPermission,
|
||||||
@ -198,7 +199,9 @@ router.put(
|
|||||||
member_id = req.user_id;
|
member_id = req.user_id;
|
||||||
rights.hasThrow("JOIN_GUILDS");
|
rights.hasThrow("JOIN_GUILDS");
|
||||||
} else {
|
} else {
|
||||||
// TODO: join others by controller
|
// TODO: check oauth2 scope
|
||||||
|
|
||||||
|
throw DiscordApiErrors.MISSING_REQUIRED_OAUTH2_SCOPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const guild = await Guild.findOneOrFail({
|
const guild = await Guild.findOneOrFail({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user