summaryrefslogtreecommitdiff
path: root/src/server/api/private
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/private')
-rw-r--r--src/server/api/private/signup.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts
index 4842a534bf..80f2d87b12 100644
--- a/src/server/api/private/signup.ts
+++ b/src/server/api/private/signup.ts
@@ -36,7 +36,7 @@ export default async (ctx: Koa.BaseContext) => {
const username = body['username'];
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'];
if (instance && instance.disableRegistration) {
@@ -109,7 +109,7 @@ export default async (ctx: Koa.BaseContext) => {
createdAt: new Date(),
username: username,
usernameLower: username.toLowerCase(),
- host: toPuny(host),
+ host: host ? toPuny(host) : null,
token: secret,
isAdmin: config.autoAdmin && usersCount === 0,
}));