aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-01-27 09:41:08 -0800
committerAdam Soltys <[email protected]>2026-01-27 09:41:08 -0800
commit197c75a02560ff153d73d3fe218fed312ccceaa4 (patch)
treebbaa2bb0af2359997808544afeec0f3253bca4e6
parent360ead1d6787558a76fb16286b1a0a2dda44212e (diff)
downloadcoinos-server-197c75a02560ff153d73d3fe218fed312ccceaa4.tar.gz
coinos-server-197c75a02560ff153d73d3fe218fed312ccceaa4.zip
skip captcha for tor
-rw-r--r--routes/users.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/users.ts b/routes/users.ts
index 60fe02f5..a00c16fe 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -30,6 +30,10 @@ const verifyRecaptcha = async (response, req?) => {
const { recaptcha: secret } = config;
if (!secret) return true;
+ // Skip captcha for Tor users accessing via .onion
+ const host = req?.headers?.["host"] || "";
+ if (host.endsWith(".onion")) return true;
+
// Check for valid API key to bypass captcha
const apiKey = req?.headers?.["x-api-key"];
if (apiKey && (await db.sIsMember("apikeys", apiKey))) {