diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-23 13:56:25 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-23 13:56:25 +0900 |
| commit | 427b3dcd73d361fc77d49c33b6b4022329214f71 (patch) | |
| tree | 900846551d85e205a7e1d271e0792f90f78e423e /src/server/api/private/signup.ts | |
| parent | Fix #1957 (diff) | |
| download | misskey-427b3dcd73d361fc77d49c33b6b4022329214f71.tar.gz misskey-427b3dcd73d361fc77d49c33b6b4022329214f71.tar.bz2 misskey-427b3dcd73d361fc77d49c33b6b4022329214f71.zip | |
Fix semantic errors
Diffstat (limited to 'src/server/api/private/signup.ts')
| -rw-r--r-- | src/server/api/private/signup.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts index b969b75fc0..563b6ca845 100644 --- a/src/server/api/private/signup.ts +++ b/src/server/api/private/signup.ts @@ -14,10 +14,12 @@ if (config.recaptcha) { } export default async (ctx: Koa.Context) => { + const body = ctx.request.body as any; + // Verify recaptcha // ただしテスト時はこの機構は障害となるため無効にする if (process.env.NODE_ENV !== 'test' && config.recaptcha != null) { - const success = await recaptcha(ctx.request.body['g-recaptcha-response']); + const success = await recaptcha(body['g-recaptcha-response']); if (!success) { ctx.throw(400, 'recaptcha-failed'); @@ -25,8 +27,8 @@ export default async (ctx: Koa.Context) => { } } - const username = ctx.request.body['username']; - const password = ctx.request.body['password']; + const username = body['username']; + const password = body['password']; // Validate username if (!validateUsername(username)) { @@ -46,8 +48,8 @@ export default async (ctx: Koa.Context) => { usernameLower: username.toLowerCase(), host: null }, { - limit: 1 - }); + limit: 1 + }); // Check username already used if (usernameExist !== 0) { |