mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-04 06:35:40 +00:00
fix being able to register with taken username
This commit is contained in:
@@ -35,7 +35,7 @@ router.get("/", route({}), (req: Request, res: Response) => {
|
||||
if (uniqueUsernames) {
|
||||
// hash, revision, bucket, override, population, hash_result, as_mode
|
||||
// bucket 4 is used by the official client, and enables live checking and suggestions, 3 is only live checking
|
||||
data.assignments.push([2476969328, 0, 3, -1, 0, 9267, 0, 0]);
|
||||
data.assignments.push([2476969328, 0, 4, -1, 0, 9267, 0, 0]);
|
||||
}
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ router.post(
|
||||
}
|
||||
|
||||
res.json({
|
||||
taken: !User.isUsernameAvailable(body.username),
|
||||
taken: !(await User.isUsernameAvailable(body.username)),
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -152,7 +152,7 @@ router.patch(
|
||||
}
|
||||
|
||||
// check if username is already taken (pomelo only)
|
||||
if (!User.isUsernameAvailable(body.username))
|
||||
if (!(await User.isUsernameAvailable(body.username)))
|
||||
throw FieldErrors({
|
||||
username: {
|
||||
code: "USERNAME_ALREADY_TAKEN",
|
||||
|
||||
Reference in New Issue
Block a user