mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 08:55:37 +08:00
impr(server): also dont allow name changing for banned users
This commit is contained in:
parent
bfe39c62de
commit
5bee69a639
1 changed files with 4 additions and 0 deletions
|
@ -248,6 +248,10 @@ export async function updateName(
|
|||
|
||||
const user = await UserDAL.getUser(uid, "update name");
|
||||
|
||||
if (user.banned) {
|
||||
throw new MonkeyError(403, "Banned users cannot change their name");
|
||||
}
|
||||
|
||||
if (
|
||||
!user?.needsToChangeName &&
|
||||
Date.now() - (user.lastNameChange ?? 0) < MILLISECONDS_IN_DAY * 30
|
||||
|
|
Loading…
Reference in a new issue