mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-09-20 04:54:00 +02:00
Don't allow username change for banned users
This commit is contained in:
parent
71c01c0f3b
commit
54f8f67ed5
1 changed files with 7 additions and 2 deletions
|
@ -46,8 +46,13 @@ export async function setUsername(req: Request, res: Response): Promise<Response
|
|||
}
|
||||
|
||||
try {
|
||||
const row = await db.prepare("get", `SELECT count(*) as count FROM "userNames" WHERE "userID" = ? AND "locked" = '1'`, [userID]);
|
||||
if (adminUserIDInput === undefined && row.count > 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue