Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

470 B
Raw Blame
import { ErrorCode } from '@activepieces/core-utils';

import { HttpError } from '@/lib/api';

const REJECTION_MESSAGE = 'captchaVerificationFailed';

function isRejection(error: HttpError): boolean {
  const body = error.response?.data as
    | { code?: ErrorCode; params?: { message?: string } }
    | undefined;
  return (
    body?.code === ErrorCode.VALIDATION &&
    body?.params?.message === REJECTION_MESSAGE
  );
}

export const captchaUtils = { isRejection };