# Copyright 2020-2026 Lowdefy, Inc # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. _ref: path: templates/blocks/gallery.yaml.njk vars: pageId: Captcha pageTitle: Captcha filePath: blocks/input/Captcha.yaml block_type: Captcha github_path: packages/plugins/blocks/blocks-captcha/src/blocks/Captcha schema: ../plugins/blocks/blocks-captcha/src/blocks/Captcha/meta.js gallery: ../plugins/blocks/blocks-captcha/src/blocks/Captcha/gallery.yaml note: > The widget script loads from the provider's CDN at render - apps behind a strict CSP should allowlist challenges.cloudflare.com. Tokens are single-use and short-lived: pass the block value as the `captchaToken` param of auth actions, and call the block's `reset` method from the action's `onError` chain to mint a fresh token for retries. description: > Renders a captcha widget (Cloudflare Turnstile) and writes the minted token into state under its blockId. Configure `provider` and `siteKey` from the `_build.authConfig` projection when `auth.captcha` is enabled. The `reset` method clears the value and mints a fresh token; expiry clears the value automatically.