Skip to content

fix: 启用 Turnstile 前先保存密钥(#135) - #143

Merged
woncc merged 1 commit into
mainfrom
cursor/upstream-issue-135-a3851c29e-20261105
Nov 5, 2026
Merged

woncc merged 1 commit into
mainfrom
cursor/upstream-issue-135-a3851c29e-20261105

Conversation

@woncc

@woncc woncc commented Nov 4, 2026

Copy link
Copy Markdown

🔗 关联任务 / Related Issue

Closes #135

上游:QuantumNous@a3851c2 (QuantumNous#7960)

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)

📝 变更描述 / Description

首次填写 Turnstile 密钥并启用时,先保存 Site Key、Secret Key,再发送启用请求,避免服务端因尚未配置 Site Key 而拒绝。仅移植指定上游的两个文件,保留 fork 的共享设置组件、请求和错误处理,无新增文案、依赖或数据库改动。

由 Codex AI 辅助移植及验证;git 身份 woncc 与历史主要作者一致。以下为代理验证记录,人工审阅待完成。

📸 运行证明 / Proof of Work

在 web/ 执行:

  • bun run test src/features/system-settings/auth/__tests__/bot-protection-settings.test.tsx:原代码 1 例失败(启用请求排在密钥前),修复后 1/1 通过。
  • GOMAXPROCS=2 bun run typecheck:退出 0。
  • bun x oxlint -c .oxlintrc.json src/features/system-settings/auth/bot-protection-section.tsx src/features/system-settings/auth/__tests__/bot-protection-settings.test.tsx:退出 0。
  • 根目录 git diff --cached --check:通过;两个目标文件与上游提交结果完全一致。

仅请求顺序变更,无视觉布局变更。测试使用模拟 API;未做真实 Cloudflare、生产浏览器或全量认证验收。
安全参考:Authentication、Session、MFA、CSRF。本次仅修复 CAPTCHA 配置提交次序,保留服务端校验,不声明全系统 ASVS 合规。

✅ 提交前检查项 / Checklist

@woncc
woncc merged commit a50096f into main Nov 5, 2026
@woncc
woncc deleted the cursor/upstream-issue-135-a3851c29e-20261105 branch December 2, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[上游/现在能解] a3851c29e 启用 Turnstile 前先保存密钥

1 participant