wip
This commit is contained in:
@ -11,9 +11,9 @@ export default async (ctx: Koa.Context) => {
|
||||
ctx.set('Access-Control-Allow-Origin', config.url);
|
||||
ctx.set('Access-Control-Allow-Credentials', 'true');
|
||||
|
||||
const username = ctx.body['username'];
|
||||
const password = ctx.body['password'];
|
||||
const token = ctx.body['token'];
|
||||
const username = ctx.request.body['username'];
|
||||
const password = ctx.request.body['password'];
|
||||
const token = ctx.request.body['token'];
|
||||
|
||||
if (typeof username != 'string') {
|
||||
ctx.status = 400;
|
||||
|
@ -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)) {
|
||||
|
Reference in New Issue
Block a user