mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
Fix update account name rate limit (#1800)
Change rate limit from seconds to milliseconds
This commit is contained in:
parent
ff27ab8139
commit
71663fc277
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ class UsersDAO {
|
|||
.findOne({ name: { $regex: new RegExp(`^${name}$`, "i") } });
|
||||
if (nameDoc) throw new MonkeyError(409, "Username already taken");
|
||||
let user = await mongoDB().collection("users").findOne({ uid });
|
||||
if (Date.now() - user.lastNameChange < 2592000) {
|
||||
if (Date.now() - user.lastNameChange < 2592000000) {
|
||||
throw new MonkeyError(409, "You can change your name once every 30 days");
|
||||
}
|
||||
return await mongoDB()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue