summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/api/private/signup.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts
index d6eba69817..ab7342d6b8 100644
--- a/src/server/api/private/signup.ts
+++ b/src/server/api/private/signup.ts
@@ -67,6 +67,8 @@ export default async (ctx: Koa.Context) => {
return;
}
+ const usersCount = await User.count({});
+
// Fetch exist user that same username
const usernameExist = await User
.count({
@@ -106,6 +108,7 @@ export default async (ctx: Koa.Context) => {
token: secret,
email: null,
password: hash,
+ isAdmin: config.autoAdmin && usersCount === 0,
profile: {
bio: null,
birthday: null,