Refactor codes

This commit is contained in:
Acid Chicken (硫酸鶏)
2020-04-29 05:30:58 +09:00
parent b862c055ae
commit 9daa900793
3 changed files with 8 additions and 17 deletions

View File

@ -14,7 +14,7 @@ export default async (ctx: Koa.Context) => {
// ただしテスト時はこの機構は障害となるため無効にする
if (process.env.NODE_ENV !== 'test' && instance.enableHcaptcha && instance.hcaptchaSecretKey) {
const success = await verify(instance.hcaptchaSecretKey, body['hcaptcha-response']).then(
({ 'error-codes': x }) => !x || !x.length,
({ success }) => success,
() => false,
);