This commit is contained in:
syuilo 2018-04-13 09:44:00 +09:00
parent 61f21594a9
commit 22d2f2051c
10 changed files with 40 additions and 26 deletions

View file

@ -37,7 +37,7 @@ export default async (ctx: Koa.Context) => {
// Verify recaptcha
// ただしテスト時はこの機構は障害となるため無効にする
if (process.env.NODE_ENV !== 'test') {
const success = await recaptcha(ctx.body['g-recaptcha-response']);
const success = await recaptcha(ctx.request.body['g-recaptcha-response']);
if (!success) {
ctx.throw(400, 'recaptcha-failed');
@ -45,8 +45,8 @@ export default async (ctx: Koa.Context) => {
}
}
const username = ctx.body['username'];
const password = ctx.body['password'];
const username = ctx.request.body['username'];
const password = ctx.request.body['password'];
// Validate username
if (!validateUsername(username)) {