summaryrefslogtreecommitdiff
path: root/src/server/api/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/common')
-rw-r--r--src/server/api/common/signup.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/api/common/signup.ts b/src/server/api/common/signup.ts
index b6e13b36f1..26a9d03e0f 100644
--- a/src/server/api/common/signup.ts
+++ b/src/server/api/common/signup.ts
@@ -22,8 +22,6 @@ export async function signup(username: User['username'], password: UserProfile['
throw new Error('INVALID_PASSWORD');
}
- const usersCount = await Users.count({});
-
// Generate hash of password
const salt = await bcrypt.genSalt(8);
const hash = await bcrypt.hash(password, salt);
@@ -76,7 +74,9 @@ export async function signup(username: User['username'], password: UserProfile['
usernameLower: username.toLowerCase(),
host: toPunyNullable(host),
token: secret,
- isAdmin: usersCount === 0,
+ isAdmin: (await Users.count({
+ host: null,
+ })) === 0,
}));
await transactionalEntityManager.save(new UserKeypair({