Repository navigation
fix: 启用 Turnstile 前先保存密钥(#135) - #143
Merged
Merged
Conversation
Port upstream a3851c2 (QuantumNous#7960).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 关联任务 / Related Issue
Closes #135
上游:QuantumNous@a3851c2 (QuantumNous#7960)
🚀 变更类型 / Type of change
📝 变更描述 / 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