mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-17 21:03:31 +08:00
parent
6554b8b0ec
commit
5545b8e0a3
1 changed files with 7 additions and 1 deletions
|
|
@ -127,6 +127,12 @@ export async function linkDiscord(
|
|||
const useRedisForBotTasks = req.ctx.configuration.useRedisForBotTasks.enabled;
|
||||
|
||||
const userInfo = await UsersDAO.getUser(uid);
|
||||
if (userInfo.discordId) {
|
||||
throw new MonkeyError(
|
||||
409,
|
||||
"This account is already linked to a Discord account"
|
||||
);
|
||||
}
|
||||
if (userInfo.banned) {
|
||||
throw new MonkeyError(403, "Banned accounts cannot link with Discord");
|
||||
}
|
||||
|
|
@ -145,7 +151,7 @@ export async function linkDiscord(
|
|||
if (!discordIdAvailable) {
|
||||
throw new MonkeyError(
|
||||
409,
|
||||
"This Discord account is already linked to a different account"
|
||||
"This Discord account is linked to a different account"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue