1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-11 21:29:08 +09:00
This commit is contained in:
syuilo 2019-04-13 15:18:12 +09:00
parent 14bcb813cc
commit 5fcf5bc635
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -36,7 +36,7 @@ export default async (ctx: Koa.BaseContext) => {
const username = body['username']; const username = body['username'];
const password = body['password']; const password = body['password'];
const host = process.env.NODE_ENV === 'test' ? (body['host'] || null) : null; const host: string | null = process.env.NODE_ENV === 'test' ? (body['host'] || null) : null;
const invitationCode = body['invitationCode']; const invitationCode = body['invitationCode'];
if (instance && instance.disableRegistration) { if (instance && instance.disableRegistration) {
@ -109,7 +109,7 @@ export default async (ctx: Koa.BaseContext) => {
createdAt: new Date(), createdAt: new Date(),
username: username, username: username,
usernameLower: username.toLowerCase(), usernameLower: username.toLowerCase(),
host: toPuny(host), host: host ? toPuny(host) : null,
token: secret, token: secret,
isAdmin: config.autoAdmin && usersCount === 0, isAdmin: config.autoAdmin && usersCount === 0,
})); }));