{"id":18561185,"url":"https://github.com/apostrophecms/login-hcaptcha","last_synced_at":"2026-02-05T16:31:20.415Z","repository":{"id":59506380,"uuid":"518402740","full_name":"apostrophecms/login-hcaptcha","owner":"apostrophecms","description":"Adds hCaptcha to Apostrophe login pages","archived":false,"fork":false,"pushed_at":"2024-10-03T14:12:18.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T21:29:45.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apostrophecms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-27T09:58:52.000Z","updated_at":"2024-10-03T14:12:09.000Z","dependencies_parsed_at":"2024-01-24T19:30:13.730Z","dependency_job_id":"36099c36-af6f-4986-bd1f-aeb66ecfdfeb","html_url":"https://github.com/apostrophecms/login-hcaptcha","commit_stats":{"total_commits":40,"total_committers":7,"mean_commits":5.714285714285714,"dds":0.6,"last_synced_commit":"a34d18d6d437765cea94d5812fa817b4511ff8a8"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/apostrophecms/login-hcaptcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Flogin-hcaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Flogin-hcaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Flogin-hcaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Flogin-hcaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostrophecms","download_url":"https://codeload.github.com/apostrophecms/login-hcaptcha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Flogin-hcaptcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29125819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T22:06:04.648Z","updated_at":"2026-02-05T16:31:20.395Z","avatar_url":"https://github.com/apostrophecms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/apostrophecms/apostrophe/main/logo.svg\" alt=\"ApostropheCMS logo\" width=\"80\" height=\"80\"\u003e\n\n  \u003ch1\u003eApostrophe hCaptcha Login Verification\u003c/h1\u003e\n  \u003cp\u003e\n    \u003ca aria-label=\"Apostrophe logo\" href=\"https://v3.docs.apostrophecms.org\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/MADE%20FOR%20ApostropheCMS-000000.svg?style=for-the-badge\u0026logo=Apostrophe\u0026labelColor=6516dd\"\u003e\n    \u003c/a\u003e\n    \u003ca aria-label=\"Test status\" href=\"https://github.com/apostrophecms/login-hcaptcha/actions\"\u003e\n      \u003cimg alt=\"GitHub Workflow Status (branch)\" src=\"https://img.shields.io/github/workflow/status/apostrophecms/login-hcaptcha/Tests/main?label=Tests\u0026labelColor=000000\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca aria-label=\"Join the community on Discord\" href=\"http://chat.apostrophecms.org\"\u003e\n      \u003cimg alt=\"\" src=\"https://img.shields.io/discord/517772094482677790?color=5865f2\u0026label=Join%20the%20Discord\u0026logo=discord\u0026logoColor=fff\u0026labelColor=000\u0026style=for-the-badge\u0026logoWidth=20\"\u003e\n    \u003c/a\u003e\n    \u003ca aria-label=\"License\" href=\"https://github.com/apostrophecms/login-hcaptcha/blob/main/LICENSE.md\"\u003e\n      \u003cimg alt=\"\" src=\"https://img.shields.io/static/v1?style=for-the-badge\u0026labelColor=000000\u0026label=License\u0026message=MIT\u0026color=3DA639\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nThis login verification module adds a [hCaptcha](https://hcaptcha.com) check when any user logs into the site.\n\n## Installation\n\nTo install the module, use the command line to run this command in an Apostrophe project's root directory:\n\n```\nnpm install @apostrophecms/login-hcaptcha\n```\n\n## Usage\n\nInstantiate the hCaptcha login module in the `app.js` file:\n\n```javascript\nrequire('apostrophe')({\n  shortName: 'my-project',\n  modules: {\n    '@apostrophecms/login-hcaptcha': {}\n  }\n});\n```\n\nThe other requirement is to add your [hCaptcha public API site key](https://docs.hcaptcha.com/configuration#hcaptcha-container-configuration) to the `@apostrophecms/login` module (*not* this module). This module adds functionality to that module (it \"improves\" it, in Apostrophe speak), so most configuration should be directly on the core login module.\n\n\n```javascript\n// modules/@apostrophecms/login/index.js\nmodule.exports = {\n  options: {\n    hcaptcha: {\n      site: 'ADD YOUR SITE KEY',\n      secret: 'ADD YOUR SECRET KEY'\n    }\n  }\n};\n```\n\nOnce configured, hCaptcha verification should work on all login attempts.\n\n### Content security headers\n\nIf your site has a content security policy, including if you use the [Apostrophe Security Headers](https://www.npmjs.com/package/@apostrophecms/security-headers) module, you will need to add additional configuration to use this module. This module adds a script tag to the site's `head` tag fetching hCaptcha code, so we need to allow resources from that domain.\n\n**If you are using the Apostrophe Security Headers module**, add the following policy configuration for that module:\n\n```javascript\nmodule.exports = {\n  options: {\n    policies: {\n      'login-hcaptcha': {\n        'script-src': 'hcaptcha.com *.hcaptcha.com',\n        'frame-src': 'hcaptcha.com *.hcaptcha.com',\n        'style-src': 'hcaptcha.com *.hcaptcha.com',\n        'connect-src': 'hcaptcha.com *.hcaptcha.com'\n      },\n      // Any other policies...\n    }\n  }\n};\n```\n\n**If your content security policy is configured some other way**, add `hcaptcha.com  *.hcaptcha.com` to the `script-src`, `frame-src`, `style-src` and `connect-src` directives.\n\nPlease refer to the list at https://docs.hcaptcha.com/#content-security-policy-settings for any additional settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Flogin-hcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostrophecms%2Flogin-hcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Flogin-hcaptcha/lists"}