diff --git a/src/routes/setUsername.ts b/src/routes/setUsername.ts index 9361216..ec46ea7 100644 --- a/src/routes/setUsername.ts +++ b/src/routes/setUsername.ts @@ -46,8 +46,13 @@ export async function setUsername(req: Request, res: Response): Promise 0) { + const row = await db.prepare("get", `SELECT count(*) as userCount FROM "userNames" WHERE "userID" = ? AND "locked" = '1'`, [userID]); + if (adminUserIDInput === undefined && row.userCount > 0) { + return res.sendStatus(200); + } + + const shadowBanRow = await db.prepare("get", `SELECT count(*) as "userCount" FROM "shadowBannedUsers" WHERE "userID" = ? LIMIT 1`, [userID]); + if (adminUserIDInput === undefined && shadowBanRow.userCount > 0) { return res.sendStatus(200); } }