[659] feat(form): Add reCAPTCHA validation to form submissions - #197
Conversation
📝 WalkthroughWalkthroughThis change introduces Google reCAPTCHA validation to the website's form handling. It updates the form widget template, adds server-side and client-side reCAPTCHA verification logic, integrates validation schemas, adjusts form error handling and styling, and includes new modules and tests for reCAPTCHA validation and error management. Dependencies for HTTP requests and abort handling are added. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant FormWidget (Client)
participant Server
participant Google reCAPTCHA
User->>Browser: Loads form page
Browser->>FormWidget: Renders form with reCAPTCHA widget
User->>FormWidget: Fills form, completes reCAPTCHA
FormWidget->>Browser: Validates form and reCAPTCHA (client-side)
alt reCAPTCHA incomplete
FormWidget->>User: Shows reCAPTCHA error, blocks submit
else reCAPTCHA complete
FormWidget->>Server: Submits form with reCAPTCHA token
Server->>Google reCAPTCHA: Verifies token (server-side)
alt Verification fails
Server->>FormWidget: Returns error, blocks submission
else Verification succeeds
Server->>FormWidget: Processes form, returns success or other errors
end
end
Suggested reviewers
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
website/modules/custom-form/index.js (1)
7-11: Consider adding parameter validation.The submit handler should validate the
reqparameter to ensure it has the expected structure before accessing nested properties.async submit(req) { + if (!req || !req.apos || !req.body) { + return req.res.status(400).json({ error: 'Invalid request structure.' }); + } const global = await req.apos.global.get(req); const recaptchaToken = req.body['g-recaptcha-response'];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
website/app.js(1 hunks)website/modules/@apostrophecms/form-widget/views/widget.html(1 hunks)website/modules/custom-form/index.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.{js,jsx}`: Use 2 spaces for indentation Maximum line length: 80 characters...
**/*.{js,jsx}: Use 2 spaces for indentation
Maximum line length: 80 characters
Use semicolons at the end of statements
Use single quotes for strings
Add trailing commas in arrays, objects, etc.
No trailing spaces
Use consistent quote properties (either quote all properties or none)
Place line comments above code, not inline
Capitalize all comments
No inline comments
Maximum function length enforced (avoid excessive length)
Maximum depth: 4 levels
Maximum callback nesting: 3 levels
Maximum parameters: 5
Maximum statements per function: 50
Use function declarations with named functions, not function expressions
Always initialize variables at declaration
Maximum lines per file: 300
Use destructuring where possible
Minimum identifier length enforced (no single-letter variables)
No unused variables
No reassignment of function parameters
No invalid 'this' context
No duplicate object keys
No ternary operators (use if/else)
Maximum complexity: 15 (cognitive complexity)
No alerts or console logs
No debugger statements
No identical expressions in conditions
Use optimized regex patterns
Use Unicode regex patterns
No secrets in code
No unsanitized methods or properties (XSS prevention)
Sort imports alphabetically
No unresolved imports
No importing default from a module that doesn't have a default export
Always return in promise chains
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/app.jswebsite/modules/custom-form/index.js
`**/*.js`: No missing imports in Node.js No missing require statements
**/*.js: No missing imports in Node.js
No missing require statements
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/app.jswebsite/modules/custom-form/index.js
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: VitalyyP
PR: speedandfunction/website#155
File: website/modules/@apostrophecms/form/index.js:7-18
Timestamp: 2025-06-06T07:47:18.719Z
Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
website/app.js (1)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
website/modules/@apostrophecms/form-widget/views/widget.html (3)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: VitalyyP
PR: speedandfunction/website#155
File: website/modules/@apostrophecms/form/index.js:7-18
Timestamp: 2025-06-06T07:47:18.719Z
Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
website/modules/custom-form/index.js (2)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: VitalyyP
PR: speedandfunction/website#155
File: website/modules/@apostrophecms/form/index.js:7-18
Timestamp: 2025-06-06T07:47:18.719Z
Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: e2e-tests
- GitHub Check: unit-tests
- GitHub Check: lint
- GitHub Check: security-scan
🔇 Additional comments (12)
website/app.js (1)
115-115: LGTM! Module integration looks correct.The addition of the custom-form module to the configuration follows ApostropheCMS conventions and properly integrates the new reCAPTCHA functionality.
website/modules/custom-form/index.js (4)
3-4: LGTM! Module structure follows ApostropheCMS conventions.The module correctly extends the @apostrophecms/form module using the standard extension pattern.
13-16: LGTM! Proper validation of reCAPTCHA token presence.The conditional check for reCAPTCHA enablement and token presence is well-implemented with appropriate error response.
44-44: LGTM! Proper delegation to parent handler.The fallback to the original Apostrophe form submit handler is correctly implemented.
1-1: Verify node-fetch is declared and installedI wasn’t able to locate a package.json or node_modules directory in the workspace. Please confirm that
node-fetchis listed under dependencies in your project’s manifest and installed, so that// website/modules/custom-form/index.js (line 1) const fetch = require('node-fetch');will resolve correctly at runtime.
• Check your package.json (or equivalent) for
"node-fetch"under dependencies
• If it’s missing, runnpm install node-fetch(or the appropriate package manager command)website/modules/@apostrophecms/form-widget/views/widget.html (7)
12-14: LGTM! Template structure reorganization improves readability.The reorganization of the form parameters logic maintains functionality while improving code structure.
16-22: LGTM! Form attributes are properly configured.The form element has appropriate attributes for security and functionality, including proper action URL and form validation settings.
23-23: LGTM! Form contents area placement is logical.Moving the form contents area before the reCAPTCHA widget and submit button creates a more intuitive form flow.
25-30: LGTM! Conditional reCAPTCHA rendering is properly implemented.The conditional rendering of the reCAPTCHA script and widget aligns with the backend validation logic and follows best practices.
32-35: LGTM! Submit button is properly configured.The submit button is correctly implemented without conditional disabling, allowing for proper form submission flow.
37-55: LGTM! Error messages are properly structured with accessibility attributes.The error message containers have appropriate
role="alert"attributes and conditional rendering, ensuring good accessibility and user experience.
57-73: LGTM! Spinner and thank-you messages are well-organized.The spinner and thank-you message sections are properly structured with appropriate classes and accessibility attributes.
- Add verifyRecaptcha utility and tests for Google reCAPTCHA validation - Integrate reCAPTCHA check in form module submit route - Update validationSchemas to require and validate reCAPTCHA token
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
website/modules/@apostrophecms/form/index.js (1)
25-36: Optimize global document retrieval and improve error handling.The global document is retrieved on every request, which could impact performance. Consider caching or checking if reCAPTCHA is needed before retrieval.
- const globalDoc = await self.apos.global.find(req).toObject(); const recaptchaToken = formData['g-recaptcha-response']; - if (globalDoc.useRecaptcha && globalDoc.recaptchaSecret) { + if (recaptchaToken) { + const globalDoc = await self.apos.global.find(req).toObject(); + if (globalDoc.useRecaptcha && globalDoc.recaptchaSecret) { const result = await verifyRecaptcha({ secret: globalDoc.recaptchaSecret, token: recaptchaToken, remoteip: req.ip, }); if (!result.success) { return res.status(400).json({ error: result.error }); } + } else if (globalDoc.useRecaptcha) { + return res.status(500).json({ error: 'reCAPTCHA configuration error' }); + } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
website/modules/@apostrophecms/form/index.js(3 hunks)website/modules/@apostrophecms/form/lib/verifyRecaptcha.js(1 hunks)website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js(1 hunks)website/modules/asset/ui/src/js/validationSchemas.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.{js,jsx}`: Use 2 spaces for indentation Maximum line length: 80 characters...
**/*.{js,jsx}: Use 2 spaces for indentation
Maximum line length: 80 characters
Use semicolons at the end of statements
Use single quotes for strings
Add trailing commas in arrays, objects, etc.
No trailing spaces
Use consistent quote properties (either quote all properties or none)
Place line comments above code, not inline
Capitalize all comments
No inline comments
Maximum function length enforced (avoid excessive length)
Maximum depth: 4 levels
Maximum callback nesting: 3 levels
Maximum parameters: 5
Maximum statements per function: 50
Use function declarations with named functions, not function expressions
Always initialize variables at declaration
Maximum lines per file: 300
Use destructuring where possible
Minimum identifier length enforced (no single-letter variables)
No unused variables
No reassignment of function parameters
No invalid 'this' context
No duplicate object keys
No ternary operators (use if/else)
Maximum complexity: 15 (cognitive complexity)
No alerts or console logs
No debugger statements
No identical expressions in conditions
Use optimized regex patterns
Use Unicode regex patterns
No secrets in code
No unsanitized methods or properties (XSS prevention)
Sort imports alphabetically
No unresolved imports
No importing default from a module that doesn't have a default export
Always return in promise chains
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/validationSchemas.jswebsite/modules/@apostrophecms/form/lib/verifyRecaptcha.test.jswebsite/modules/@apostrophecms/form/index.jswebsite/modules/@apostrophecms/form/lib/verifyRecaptcha.js
`**/*.js`: No missing imports in Node.js No missing require statements
**/*.js: No missing imports in Node.js
No missing require statements
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/validationSchemas.jswebsite/modules/@apostrophecms/form/lib/verifyRecaptcha.test.jswebsite/modules/@apostrophecms/form/index.jswebsite/modules/@apostrophecms/form/lib/verifyRecaptcha.js
`**/*.test.{js,jsx}`: Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
**/*.test.{js,jsx}: Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: VitalyyP
PR: speedandfunction/website#155
File: website/modules/@apostrophecms/form/index.js:7-18
Timestamp: 2025-06-06T07:47:18.719Z
Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js (2)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to **/*.test.{js,jsx} : Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to **/*.e2e.{js,jsx} : E2E test files: relaxed import, ternary, and sorting rules
website/modules/@apostrophecms/form/index.js (2)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: VitalyyP
PR: speedandfunction/website#155
File: website/modules/@apostrophecms/form/index.js:7-18
Timestamp: 2025-06-06T07:47:18.719Z
Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.
🧬 Code Graph Analysis (1)
website/modules/@apostrophecms/form/index.js (1)
website/modules/@apostrophecms/form/lib/verifyRecaptcha.js (1)
verifyRecaptcha(3-34)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: lint
- GitHub Check: e2e-tests
- GitHub Check: unit-tests
- GitHub Check: security-scan
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js (1)
1-62: Excellent test coverage and implementation!The test suite comprehensively covers all scenarios:
- Missing token validation
- Failed verification responses
- Successful verification
- HTTP error handling
The mocking approach is appropriate and the test structure follows best practices.
website/modules/@apostrophecms/form/lib/verifyRecaptcha.js (1)
25-25: Add error handling for JSON parsing.The
response.json()call can throw an error if the response is not valid JSON.- const data = await response.json(); + let data; + try { + data = await response.json(); + } catch (error) { + return { success: false, error: 'Invalid response from reCAPTCHA service.' }; + }⛔ Skipped due to learnings
Learnt from: VitalyyP PR: speedandfunction/website#155 File: website/modules/@apostrophecms/form/index.js:7-18 Timestamp: 2025-06-06T07:47:18.719Z Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.website/modules/@apostrophecms/form/index.js (1)
17-49: LGTM! Well-structured reCAPTCHA integration.The extraction of the inline handler to a named function significantly improves code organization and readability. The reCAPTCHA verification logic is properly integrated with appropriate error handling and status codes.
The error handling follows the established pattern from previous learnings, allowing errors to bubble up to higher-level handlers.
- Exclude 'g-recaptcha-response' from headers and row data in formatForSpreadsheet - Update header and row generation logic to filter out recaptcha field
- Change node-fetch version from ^3.3.2 to ^2.7.0 in package.json - Update package-lock.json to reflect dependency change
- Delete website/modules/custom-form/index.js - Remove 'custom-form' from modules list in website/app.js
- Refactor reCAPTCHA error message placement in widget.html - Add client-side reCAPTCHA validation to formValidation.js - Update SCSS for new captcha error styles and positioning
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
website/modules/asset/ui/src/js/formValidation.js (2)
213-213: Remove unnecessary empty line.This empty line after
event.preventDefault();appears unnecessary and doesn't follow the coding style.- event.preventDefault(); - + event.preventDefault();
216-233: Add error handling for reCAPTCHA script loading failures.The reCAPTCHA validation logic is well-implemented, but it assumes the reCAPTCHA script loads successfully. Consider adding error handling for cases where the script fails to load or the widget isn't properly initialized.
// ReCAPTCHA validation (client-side) const recaptchaWidget = form.querySelector('.g-recaptcha'); const recaptchaError = document.querySelector( '[data-apos-form-recaptcha-error]', ); if ( - typeof window.grecaptcha !== 'undefined' && + typeof window.grecaptcha !== 'undefined' && + typeof window.grecaptcha.getResponse === 'function' && recaptchaWidget && !window.grecaptcha.getResponse() ) {website/modules/asset/ui/src/scss/_form.scss (2)
55-58: Consider making the reCAPTCHA error positioning more responsive.The fixed
left: 129pxvalue appears to be a magic number that might not work well across different screen sizes or reCAPTCHA widget variations.Consider using a more flexible positioning approach:
.apos-form-captcha-error { bottom: 0px; - left: 129px; + left: 50%; + transform: translateX(-50%); + + @include breakpoint-medium { + left: 129px; + transform: none; + } }
179-194: Clean up commented-out code.The consolidated error message styles look good, but the commented-out positioning code should be removed to keep the stylesheet clean.
.validation-error, .apos-form-error, .apos-form-captcha-error { position: absolute; - // bottom: -4px; - // left: 5px; - // @include breakpoint-medium { - // left: 25px; - // } color: $error-color; font-size: 12px; margin-top: -5px; margin-bottom: 10px; font-weight: 500; line-height: 110%; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
website/modules/@apostrophecms/form-widget/views/widget.html(1 hunks)website/modules/asset/ui/src/js/formValidation.js(1 hunks)website/modules/asset/ui/src/scss/_form.scss(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- website/modules/@apostrophecms/form-widget/views/widget.html
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.{js,jsx}`: Use 2 spaces for indentation Maximum line length: 80 characters...
**/*.{js,jsx}: Use 2 spaces for indentation
Maximum line length: 80 characters
Use semicolons at the end of statements
Use single quotes for strings
Add trailing commas in arrays, objects, etc.
No trailing spaces
Use consistent quote properties (either quote all properties or none)
Place line comments above code, not inline
Capitalize all comments
No inline comments
Maximum function length enforced (avoid excessive length)
Maximum depth: 4 levels
Maximum callback nesting: 3 levels
Maximum parameters: 5
Maximum statements per function: 50
Use function declarations with named functions, not function expressions
Always initialize variables at declaration
Maximum lines per file: 300
Use destructuring where possible
Minimum identifier length enforced (no single-letter variables)
No unused variables
No reassignment of function parameters
No invalid 'this' context
No duplicate object keys
No ternary operators (use if/else)
Maximum complexity: 15 (cognitive complexity)
No alerts or console logs
No debugger statements
No identical expressions in conditions
Use optimized regex patterns
Use Unicode regex patterns
No secrets in code
No unsanitized methods or properties (XSS prevention)
Sort imports alphabetically
No unresolved imports
No importing default from a module that doesn't have a default export
Always return in promise chains
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/formValidation.js
`**/*.js`: No missing imports in Node.js No missing require statements
**/*.js: No missing imports in Node.js
No missing require statements
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/formValidation.js
🧠 Learnings (3)
📓 Common learnings
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
website/modules/asset/ui/src/scss/_form.scss (7)
Learnt from: yuramax
PR: speedandfunction/website#121
File: website/modules/asset/ui/src/scss/_vacancies.scss:99-102
Timestamp: 2025-05-26T15:57:01.766Z
Learning: In website/modules/asset/ui/src/scss/_vacancies.scss, the margin shorthand (e.g., `margin: 0 0 8px`) in `.sf-vacancies_footer h2` is intentionally used to reset all margins and set specific bottom margins, rather than using `margin-bottom` alone. This approach ensures clean baseline styling that doesn't inherit unwanted margins, while still allowing the sibling selector `.vacancy-card + .sf-vacancies_footer h2` to add top margins when a vacancy card precedes the footer.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:10.045Z
Learning: In the website project, the `.sf-form` CSS class selector is intentionally used in form validation because it's the class used in the form widget template, not an inconsistency that needs to be fixed.
Learnt from: IhorMasechko
PR: speedandfunction/website#132
File: website/modules/asset/ui/src/scss/_not-found.scss:52-64
Timestamp: 2025-05-29T07:16:52.843Z
Learning: In website/modules/asset/ui/src/scss/_not-found.scss, the .two-buttons container with flex-direction: row and child .sf-button elements having width: 100% does not cause overflow issues and renders correctly, despite theoretical expectations.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/asset/ui/src/index.js : modules/asset/ui/src/index.js: relaxed function lines and style rules
Learnt from: yuramax
PR: speedandfunction/website#191
File: website/modules/asset/ui/src/scss/_leadership-team.scss:213-216
Timestamp: 2025-07-02T08:15:36.152Z
Learning: In website/modules/asset/ui/src/scss/_leadership-team.scss, the `.leader-bio` element intentionally uses `overflow-y: hidden` at the `breakpoint-extra-large` level to completely remove scrollbars on desktop devices, while maintaining `overflow-y: auto` at the `breakpoint-large` level for tablets. This design decision relies on content managers controlling bio text length to prevent overflow on desktop, ensuring a clean scrollbar-free experience on larger screens.
website/modules/asset/ui/src/js/formValidation.js (1)
Learnt from: VitalyyP
PR: speedandfunction/website#155
File: website/modules/@apostrophecms/form/index.js:7-18
Timestamp: 2025-06-06T07:47:18.719Z
Learning: In website/modules/@apostrophecms/form/index.js, the parseFormData function intentionally does not include try-catch for JSON.parse errors to avoid nested error handling. Errors are allowed to bubble up to higher-level handlers where they can be properly logged and handled, keeping the error handling architecture simpler and more maintainable.
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: lint
- GitHub Check: e2e-tests
- GitHub Check: unit-tests
- GitHub Check: security-scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
website/modules/asset/ui/src/js/formValidation.js (2)
242-250: Verify the promise chain logic for combined validation.The logic correctly combines reCAPTCHA validation with form validation using the
hasErrorflag. However, ensure that all error states are properly handled and that the form submission is prevented when either validation fails.The implementation correctly:
- Combines reCAPTCHA and form validation results
- Prevents submission when either validation fails
- Maintains the existing validation flow
256-257: Return statement placement is correct.The function correctly returns
trueimmediately after starting the asynchronous validation process, which prevents the default form submission behavior while allowing the validation to complete asynchronously.website/modules/asset/ui/src/scss/_form.scss (2)
2-2: Position relative is necessary for absolute positioning of child elements.Adding
position: relativeto the container is correct and necessary for the absolute positioning of error messages implemented later in the file.
37-40: reCAPTCHA widget styling is appropriate.The relative positioning and top margin for the
.g-recaptchawidget provides good visual separation and alignment with the form elements.
- Refactor reCAPTCHA error message markup in widget.html for clarity and structure - Adjust .apos-form-captcha-error left position and add responsive breakpoint in _form.scss
- Add recaptchaValidation.js for reCAPTCHA field event handling - Integrate addRecaptchaValidationHandlers in formValidation.js - Add unit tests for handleRecaptchaValueChange
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
website/modules/asset/ui/src/js/recaptchaValidation.test.js (1)
1-42: Test coverage is good but could be enhanced with additional edge cases.The test suite effectively covers the main scenarios for
handleRecaptchaValueChange. The setup is well-structured with proper DOM mocking and cleanup.Consider adding these additional test cases for better coverage:
+ it('handles missing error element gracefully', () => { + errorMsg.remove(); + recaptchaTextarea.value = 'token'; + expect(() => { + handleRecaptchaValueChange(recaptchaTextarea, form, clearValidationErrorFn); + }).not.toThrow(); + expect(clearValidationErrorFn).toHaveBeenCalledWith(recaptchaTextarea); + }); + + it('handles falsy values correctly', () => { + errorMsg.classList.remove('apos-form-hidden'); + recaptchaTextarea.value = null; + handleRecaptchaValueChange(recaptchaTextarea, form, clearValidationErrorFn); + expect(clearValidationErrorFn).not.toHaveBeenCalled(); + expect(errorMsg.classList.contains('apos-form-hidden')).toBe(false); + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
website/modules/asset/ui/src/js/formValidation.js(3 hunks)website/modules/asset/ui/src/js/recaptchaValidation.js(1 hunks)website/modules/asset/ui/src/js/recaptchaValidation.test.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- website/modules/asset/ui/src/js/formValidation.js
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.{js,jsx}`: Use 2 spaces for indentation Maximum line length: 80 characters...
**/*.{js,jsx}: Use 2 spaces for indentation
Maximum line length: 80 characters
Use semicolons at the end of statements
Use single quotes for strings
Add trailing commas in arrays, objects, etc.
No trailing spaces
Use consistent quote properties (either quote all properties or none)
Place line comments above code, not inline
Capitalize all comments
No inline comments
Maximum function length enforced (avoid excessive length)
Maximum depth: 4 levels
Maximum callback nesting: 3 levels
Maximum parameters: 5
Maximum statements per function: 50
Use function declarations with named functions, not function expressions
Always initialize variables at declaration
Maximum lines per file: 300
Use destructuring where possible
Minimum identifier length enforced (no single-letter variables)
No unused variables
No reassignment of function parameters
No invalid 'this' context
No duplicate object keys
No ternary operators (use if/else)
Maximum complexity: 15 (cognitive complexity)
No alerts or console logs
No debugger statements
No identical expressions in conditions
Use optimized regex patterns
Use Unicode regex patterns
No secrets in code
No unsanitized methods or properties (XSS prevention)
Sort imports alphabetically
No unresolved imports
No importing default from a module that doesn't have a default export
Always return in promise chains
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/recaptchaValidation.test.jswebsite/modules/asset/ui/src/js/recaptchaValidation.js
`**/*.js`: No missing imports in Node.js No missing require statements
**/*.js: No missing imports in Node.js
No missing require statements
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/recaptchaValidation.test.jswebsite/modules/asset/ui/src/js/recaptchaValidation.js
`**/*.test.{js,jsx}`: Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
**/*.test.{js,jsx}: Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/asset/ui/src/js/recaptchaValidation.test.js
🧠 Learnings (1)
📓 Common learnings
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
🧬 Code Graph Analysis (1)
website/modules/asset/ui/src/js/recaptchaValidation.test.js (2)
website/modules/asset/ui/src/js/recaptchaValidation.js (2)
require(1-1)handleRecaptchaValueChange(3-17)website/modules/asset/ui/src/js/formValidation.js (5)
require(1-1)require(2-2)require(3-3)form(7-7)form(15-15)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e-tests
- GitHub Check: unit-tests
- GitHub Check: security-scan
- GitHub Check: lint
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
website/modules/asset/ui/src/js/recaptchaValidation.js (1)
3-17: Function logic is correct and well-structured.The
handleRecaptchaValueChangefunction correctly handles the validation state updates and error message visibility. The optional parameter with default value provides good flexibility for testing.
- Refactor verifyRecaptcha.js to use AbortController for timeout handling - Add abort-controller dependency to package.json and package-lock.json - Update reCAPTCHA token min length validation to 70 in validationSchemas.js
- Use 'x-forwarded-for' header if present for recaptcha remoteip - Fallback to req.ip if header is missing
- Extract parameter validation to separate function - Add explicit error for missing secret and remoteip - Add tests for missing secret and remoteip cases
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
website/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
website/modules/@apostrophecms/form/index.js(3 hunks)website/modules/@apostrophecms/form/lib/verifyRecaptcha.js(1 hunks)website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js(1 hunks)website/modules/asset/ui/src/js/validationSchemas.js(1 hunks)website/package.json(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- website/modules/asset/ui/src/js/validationSchemas.js
- website/modules/@apostrophecms/form/index.js
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.{js,jsx}`: Use 2 spaces for indentation Maximum line length: 80 characters...
**/*.{js,jsx}: Use 2 spaces for indentation
Maximum line length: 80 characters
Use semicolons at the end of statements
Use single quotes for strings
Add trailing commas in arrays, objects, etc.
No trailing spaces
Use consistent quote properties (either quote all properties or none)
Place line comments above code, not inline
Capitalize all comments
No inline comments
Maximum function length enforced (avoid excessive length)
Maximum depth: 4 levels
Maximum callback nesting: 3 levels
Maximum parameters: 5
Maximum statements per function: 50
Use function declarations with named functions, not function expressions
Always initialize variables at declaration
Maximum lines per file: 300
Use destructuring where possible
Minimum identifier length enforced (no single-letter variables)
No unused variables
No reassignment of function parameters
No invalid 'this' context
No duplicate object keys
No ternary operators (use if/else)
Maximum complexity: 15 (cognitive complexity)
No alerts or console logs
No debugger statements
No identical expressions in conditions
Use optimized regex patterns
Use Unicode regex patterns
No secrets in code
No unsanitized methods or properties (XSS prevention)
Sort imports alphabetically
No unresolved imports
No importing default from a module that doesn't have a default export
Always return in promise chains
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.jswebsite/modules/@apostrophecms/form/lib/verifyRecaptcha.js
`**/*.js`: No missing imports in Node.js No missing require statements
**/*.js: No missing imports in Node.js
No missing require statements
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.jswebsite/modules/@apostrophecms/form/lib/verifyRecaptcha.js
`**/*.test.{js,jsx}`: Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
**/*.test.{js,jsx}: Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-conventions.mdc)
List of files the instruction was applied to:
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js
🧠 Learnings (4)
📓 Common learnings
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
website/package.json (2)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/@apostrophecms/form/index.js : modules/@apostrophecms/form/index.js: relaxed maximum lines rule
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to modules/asset/ui/src/swipers.js : modules/asset/ui/src/swipers.js: relaxed import rules
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js (1)
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to **/*.test.{js,jsx} : Test files have relaxed rules for function length, statements, extraneous requires, and destructuring
website/modules/@apostrophecms/form/lib/verifyRecaptcha.js (2)
Learnt from: killev
PR: speedandfunction/website#21
File: scripts/merged-prs-last-24h.js:0-0
Timestamp: 2025-04-22T06:57:44.687Z
Learning: For console scripts like merged-prs-last-24h.js, the preferred approach is to allow fatal errors rather than implementing explicit error handling with try-catch blocks, as this makes errors more visible and provides complete stack traces for debugging.
Learnt from: killev
PR: speedandfunction/website#76
File: website/modules/@apostrophecms/form/index.js:154-157
Timestamp: 2025-05-11T21:14:53.791Z
Learning: The timestamp-based ID generation in the form submission handler (using Date.now().toString() in prepareSheetData method) is a known limitation but should not be flagged in PRs focused on code style or organization. This is acceptable for now and would be addressed separately if needed.
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: e2e-tests
- GitHub Check: lint
- GitHub Check: security-scan
- GitHub Check: unit-tests
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (actions)
🔇 Additional comments (6)
website/package.json (1)
44-44: Dependency appropriately chosen for timeout handling.The abort-controller dependency is correctly added to support timeout functionality with node-fetch v2.
website/modules/@apostrophecms/form/lib/verifyRecaptcha.test.js (1)
1-82: Comprehensive test coverage for reCAPTCHA verification.The test suite covers all critical scenarios including parameter validation, API response handling, and error cases. The structure is clean and follows Jest best practices with proper mocking.
website/modules/@apostrophecms/form/lib/verifyRecaptcha.js (4)
4-15: Well-structured parameter validation.The validation function properly checks all required parameters and returns appropriate error messages. The separation of validation logic makes the code more maintainable.
17-60: Robust HTTP request implementation with proper timeout handling.The request function correctly implements:
- AbortController for reliable timeout handling
- Proper error handling for network issues
- Appropriate response validation
- Clean error messages for different failure scenarios
62-68: Clean main function with proper delegation.The main
verifyRecaptchafunction appropriately delegates to validation and request functions, maintaining clean separation of concerns.
28-28: Google reCAPTCHA endpoint is correctThe existing URL (
https://www.google.com/recaptcha/api/siteverify) matches the official Google reCAPTCHA v2 verification endpoint, so no update is needed.
9538251
…analysis - SonarQube rule can be ignored for recaptcha-script.html
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
sonar-project.properties (1)
23-24: Duplicate & overly specific exclusions warrant a quick cleanup
website/coverage/**is already excluded bysonar.coverage.exclusionson line 8, so repeating it here is redundant noise.- The single-file exclusion for
recaptcha-script.htmlis fine, but since the entirewebsite/modules/**tree is already excluded from coverage (line 11) you might consider adding the same path tosonar.exclusionsinstead of whitelisting files piecemeal. That keeps the two exclusion blocks in sync and avoids future drift.- website/coverage/**,\ - website/modules/@apostrophecms/form-widget/views/recaptcha-script.html + website/modules/**,\ + # keep any one-off overrides below this line if neededwebsite/modules/@apostrophecms/form-widget/views/recaptcha-script.html (1)
1-1: Add CSP-friendly attributes for safer third-party script loadingConsider adding
nonceandcrossorigin="anonymous"so sites with a strict Content-Security-Policy don’t have to maintain an inline-script exception for reCAPTCHA:-<script src="https://www.google.com/recaptcha/api.js" async defer></script> +<script + src="https://www.google.com/recaptcha/api.js" + async + defer + crossorigin="anonymous" + nonce="{{ apos.asset.nonce() }}" +></script>If CSP isn’t enforced yet you can ignore, but adding it now is a cheap hardening win.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
sonar-project.properties(1 hunks)website/modules/@apostrophecms/form-widget/views/recaptcha-script.html(1 hunks)website/modules/@apostrophecms/form-widget/views/widget.html(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- website/modules/@apostrophecms/form-widget/views/widget.html
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: VitalyyP
PR: speedandfunction/website#197
File: website/modules/asset/ui/src/js/recaptchaValidation.js:30-35
Timestamp: 2025-07-04T17:37:05.605Z
Learning: The recaptchaValidation.js file in the speedandfunction/website repository has proper memory leak prevention with interval cleanup, event listener removal, and DOM removal detection. The cleanup is handled automatically when elements are removed from the DOM and through a returned cleanup function.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
sonar-project.properties (2)
Learnt from: killev
PR: speedandfunction/website#4
File: sonar-project.properties:0-0
Timestamp: 2025-04-13T14:32:00.114Z
Learning: In the CI pipeline for this project, test coverage reports are generated in the website/coverage directory but are then downloaded as artifacts to the root working directory before the SonarQube scan, making sonar.javascript.lcov.reportPaths=lcov.info the correct configuration in sonar-project.properties.
Learnt from: CR
PR: speedandfunction/website#0
File: .cursor/rules/code-conventions.mdc:0-0
Timestamp: 2025-07-01T07:44:33.034Z
Learning: Applies to **/*.{js,jsx} : No secrets in code
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html (1)
Learnt from: VitalyyP
PR: speedandfunction/website#197
File: website/modules/asset/ui/src/js/recaptchaValidation.js:30-35
Timestamp: 2025-07-04T17:37:05.605Z
Learning: The recaptchaValidation.js file in the speedandfunction/website repository has proper memory leak prevention with interval cleanup, event listener removal, and DOM removal detection. The cleanup is handled automatically when elements are removed from the DOM and through a returned cleanup function.
🪛 HTMLHint (1.5.0)
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html
[error] 1-1: Doctype must be declared before any non-comment content.
(doctype-first)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e-tests
- GitHub Check: lint
- GitHub Check: unit-tests
- GitHub Check: security-scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html (1)
1-1:doctype-firstHTMLHint warning is a false positive for Apostrophe partialsThis template is an HTML fragment injected into a larger page, so omitting
<!DOCTYPE html>is intentional. Suppress the rule for theviews/directory in.htmlhintrc(or via a file-level comment) to keep pipelines green without disabling it globally.
- Move reCAPTCHA script from widget.html to recaptcha-script.html - Update widget.html to use include instead of inline script - Add recaptcha-script.html to sonar exclusions
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html (1)
1-1: Consider loading the reCAPTCHA script once and add CSP/SRI hardeningPlacing this
<script>in a per-widget partial means every form instance inserts the tag, causing redundant network requests and making CSP rollout harder.
Move the tag to a project-level asset (e.g.apos.asset.push('script', …, { when: 'always' })) or wrap the partial in anapos.util.onceguard, and add a CSPnonceor SRI hash pluscrossorigin="anonymous"for extra security.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
sonar-project.properties(1 hunks)website/modules/@apostrophecms/form-widget/views/recaptcha-script.html(1 hunks)website/modules/@apostrophecms/form-widget/views/widget.html(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- sonar-project.properties
🚧 Files skipped from review as they are similar to previous changes (1)
- website/modules/@apostrophecms/form-widget/views/widget.html
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: VitalyyP
PR: speedandfunction/website#197
File: website/modules/asset/ui/src/js/recaptchaValidation.js:30-35
Timestamp: 2025-07-04T17:37:05.605Z
Learning: The recaptchaValidation.js file in the speedandfunction/website repository has proper memory leak prevention with interval cleanup, event listener removal, and DOM removal detection. The cleanup is handled automatically when elements are removed from the DOM and through a returned cleanup function.
Learnt from: VitalyyP
PR: speedandfunction/website#169
File: website/modules/asset/ui/src/js/formValidation.js:68-71
Timestamp: 2025-06-10T14:41:04.740Z
Learning: In the website project, form validation is intentionally scoped to forms with the `.sf-form` class, which is the class used in their form widget template. This ensures validation only applies to forms created by their specific widget, not all forms on the page.
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html (1)
Learnt from: VitalyyP
PR: speedandfunction/website#197
File: website/modules/asset/ui/src/js/recaptchaValidation.js:30-35
Timestamp: 2025-07-04T17:37:05.605Z
Learning: The recaptchaValidation.js file in the speedandfunction/website repository has proper memory leak prevention with interval cleanup, event listener removal, and DOM removal detection. The cleanup is handled automatically when elements are removed from the DOM and through a returned cleanup function.
🪛 HTMLHint (1.5.0)
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html
[error] 1-1: Doctype must be declared before any non-comment content.
(doctype-first)
🔇 Additional comments (1)
website/modules/@apostrophecms/form-widget/views/recaptcha-script.html (1)
1-1: Ignore “doctype-first” HTMLHint warningThis file is a fragment, not a standalone HTML document, so omitting the
<!doctype>is expected.
|



Uh oh!
There was an error while loading. Please reload this page.