mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 15:26:15 +08:00
not checking last name change if user needs to change name
This commit is contained in:
parent
9026893571
commit
1baa5c1651
|
@ -57,7 +57,10 @@ export async function updateName(
|
|||
|
||||
const user = await getUser(uid, "update name");
|
||||
|
||||
if (Date.now() - (user.lastNameChange ?? 0) < 2592000000) {
|
||||
if (
|
||||
!user?.needsToUpdateName &&
|
||||
Date.now() - (user.lastNameChange ?? 0) < 2592000000
|
||||
) {
|
||||
throw new MonkeyError(409, "You can change your name once every 30 days");
|
||||
}
|
||||
if (!isUsernameValid(name)) {
|
||||
|
|
Loading…
Reference in a new issue