fix turnstile public key handling
All checks were successful
Generate a build and push to Cloudflare Pages / Build and Deploy to Cloudflare Pages (push) Successful in 1m24s
All checks were successful
Generate a build and push to Cloudflare Pages / Build and Deploy to Cloudflare Pages (push) Successful in 1m24s
This commit is contained in:
@@ -29,11 +29,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Create .env file
|
|
||||||
run: echo "PUBLIC_TURNSTILE_SITEKEY=${{ secrets.TURNSTILE_SITEKEY }}" > .env
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
env:
|
||||||
|
PUBLIC_TURNSTILE_SITEKEY: ${{ secrets.TURNSTILE_SITEKEY }}
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: cloudflare/wrangler-action@v3
|
uses: cloudflare/wrangler-action@v3
|
||||||
|
|||||||
@@ -10,10 +10,7 @@
|
|||||||
let turnstileWidgetId: string | null = $state(null)
|
let turnstileWidgetId: string | null = $state(null)
|
||||||
let turnstileContainer: HTMLElement
|
let turnstileContainer: HTMLElement
|
||||||
|
|
||||||
// Get Turnstile sitekey from environment variable
|
const TURNSTILE_SITEKEY = import.meta.env.PUBLIC_TURNSTILE_SITEKEY
|
||||||
// Dev: uses test key from .env
|
|
||||||
// Prod: uses real key from Cloudflare Pages env vars
|
|
||||||
const TURNSTILE_SITEKEY = import.meta.env.PUBLIC_TURNSTILE_SITEKEY || '1x00000000000000000000AA'
|
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
// Wait for Turnstile script to load
|
// Wait for Turnstile script to load
|
||||||
|
|||||||
Reference in New Issue
Block a user