Skip to content

Commit f80dc5e

Browse files
authored
Fix TURNSTILE_ACTIVE boolean evaluation
1 parent 03c9cc2 commit f80dc5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const TURNSTILE_SITE_KEY = process.env.TURNSTILE_SITE_KEY || '';
5050
const TURNSTILE_SECRET_KEY = process.env.TURNSTILE_SECRET_KEY || '';
5151
const TURNSTILE_COOKIE_NAME = process.env.TURNSTILE_COOKIE_NAME || 'cf_turnstile_token';
5252
const TURNSTILE_COOKIE_TTL_SECONDS = 6 * 60 * 60; // 6 hours
53-
const TURNSTILE_ACTIVE = TURNSTILE_ENABLED && TURNSTILE_SITE_KEY && TURNSTILE_SECRET_KEY;
53+
const TURNSTILE_ACTIVE = !!(TURNSTILE_ENABLED && TURNSTILE_SITE_KEY && TURNSTILE_SECRET_KEY);
5454
const ROOT = path.resolve(__dirname);
5555
const DEBUG_HTTP = !!process.env.DEBUG_HTTP;
5656
const API_TIMEOUT_MS = 15000; // hardcoded 15s timeout for external API calls

0 commit comments

Comments
 (0)