input('captcha_key', ''); if ($key === '') { return ApiResponse::error('captcha_key required', ErrorCode::ValidationFailed->value, null, 422); } return $this->peek($key, AdminCaptchaService::SCOPE_PLAYER); } public function admin(Request $request): JsonResponse { $key = (string) $request->input('captcha_key', ''); if ($key === '') { return ApiResponse::error('captcha_key required', ErrorCode::ValidationFailed->value, null, 422); } return $this->peek($key, AdminCaptchaService::SCOPE_ADMIN); } private function peek(string $key, string $scope): JsonResponse { return ApiResponse::success([ 'bypass_code' => 'LOTTERY_E2E_BYPASS', 'scope' => $scope, 'key' => $key, 'hint' => 'POST captcha_code=LOTTERY_E2E_BYPASS to login when LOTTERY_E2E=true', ]); } }