This commit is contained in:
syuilo 2018-11-06 06:24:31 +09:00
parent 8fd95de25b
commit ac50bb9225
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
4 changed files with 11 additions and 0 deletions

View file

@ -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,