Skip to content

Commit

Permalink
FIO-8027 added Cloudflare Turnstile as a captcha Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
HannaKurban committed Apr 17, 2024
1 parent 62ed3c7 commit 8c20e2d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 53 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"./process": "./lib/process/index.js",
"./types": "./lib/types/index.js",
"./experimental": "./lib/experimental/index.js",
"./dist/formio.core.min.js": "./dist/formio.core.min.js"
"./dist/formio.core.min.js": "./dist/formio.core.min.js",
"./error": "./lib/error/index.js"
},
"scripts": {
"test": "TEST=1 mocha -r ts-node/register -r tsconfig-paths/register -r mock-local-storage -r jsdom-global/register -b -t 0 'src/**/__tests__/*.test.ts'",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export * from './modules';
export * from './utils';
export * from './process/validation';
export * from './process/validation/rules';
export * from './process';
export * from './sdk';
export * from './types';
export * from './error';
3 changes: 0 additions & 3 deletions src/process/validation/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export const EN_ERRORS = {
invalidValueProperty: 'Invalid Value Property',
mask: '{{field}} does not match the mask.',
valueIsNotAvailable: '{{ field }} is an invalid value.',
captchaTokenValidation: 'ReCAPTCHA: Token validation error',
captchaTokenNotSpecified: 'ReCAPTCHA: Token is not specified in submission',
captchaFailure: 'ReCaptcha: Response token not found',
time: '{{field}} is not a valid time',
invalidDate: '{{field}} is not a valid date',
};
4 changes: 1 addition & 3 deletions src/process/validation/rules/databaseRules.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ValidationRuleInfo } from "types";
import { validateUniqueInfo } from "./validateUnique";
import { validateCaptchaInfo } from "./validateCaptcha";

// These are the validations that require a database connection.
export const databaseRules: ValidationRuleInfo[] = [
validateUniqueInfo,
validateCaptchaInfo
validateUniqueInfo
];
42 changes: 0 additions & 42 deletions src/process/validation/rules/validateCaptcha.ts

This file was deleted.

5 changes: 3 additions & 2 deletions src/types/project/settings/ProjectSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ProjectFileStorageConfig,
ProjectGoogleDriveConfig,
ProjectKickboxConfig,
ProjectReCaptchaConfig,
ProjectCaptchaConfig,
ProjectSQLConnectorConfig,
} from './integrations';

Expand Down Expand Up @@ -39,7 +39,8 @@ export type ProjectSettings = {

// Integrations
email?: ProjectEmailConfig;
recaptcha?: ProjectReCaptchaConfig;
captcha?: ProjectCaptchaConfig;
recaptcha?: ProjectCaptchaConfig;
esign?: ProjectESignConfig;
google?: ProjectGoogleDriveConfig;
kickbox?: ProjectKickboxConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type ProjectReCaptchaConfig = {
export type ProjectCaptchaConfig = {
siteKey: string;
secretKey: string;
};
2 changes: 1 addition & 1 deletion src/types/project/settings/integrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export * from './dataConnections';
export * from './email';
export * from './eSign';
export * from './fileStorage';
export * from './reCaptcha';
export * from './captcha';

0 comments on commit 8c20e2d

Please sign in to comment.