makecindy / makecindy/cindy

[Bug] 移动端邮箱登录点发送验证码未发出,国际版被 Turnstile 拦住

Open
#3,146 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

手机 App 邮箱登录:输入邮箱后点发送/输入验证码,直接报错,验证码没有发出。

---

## 现象

1. 打开移动端 Cindy
2. 登录页输入邮箱
3. 点继续 / 发送验证码
4. 界面报错(有报告为「登录未完成」)
5. 邮箱没有收到验证码

## 期望

- 国际版应弹出安全验证(Turnstile),通过后再发验证码
- 失败时应显示「请先完成安全验证」等具体原因,而不是含糊的「登录未完成」
- 验证码实际发出

## 结论(独立审查后更正)

**不是**「discovery 遇到未知登录方式 → `INVALID_RESPONSE`」。

已证实的发码失败原因:

- 这是**国际版**邮箱登录。中国大陆版 `providers.email = false`,登录页不走邮箱验证码。
- Global `GET /api/auth/providers`:`captcha.requiredFor = ["email_request_code"]`,邮箱发码已开 Turnstile。
- `POST /api/auth/discovery` 对普通个人邮箱只返回 `{"methods":[{"type":"email_code"}]}`,旧 schema 也能解析。
- `POST /api/auth/email/request-code` 不带 token → `400 CAPTCHA_REQUIRED`(需要先完成安全验证),**服务端不会发码**。
- dummy token → `400 CAPTCHA_INVALID`。
- 挑战页 `GET /captcha/turnstile?action=email_request_code` 返回 200。

因果链:

```text
输入邮箱 → 继续
→ discover(成功,唯一 email_code)
→ 自动 request-code
→ 服务端要求 captcha
→ 没过 Turnstile 则不发信
```

「登录未完成,请重试」是移动端对**未登记错误码**的拖底文案。现网 `CAPTCHA_REQUIRED` 在**当前包** catalog 里已有「请先完成安全验证。」。若用户看到的是拖底文案,更可能是:

1. 装机还是 captcha 接入之前的包,不认识 `CAPTCHA_REQUIRED`;或
2. 客户端在 captcha 闸上抛了未登记的错误码(闸没弹出 / WebView 失败)

## 已排除

- discovery 未知 method type(线上探测未出现)
- 中国大陆版邮箱发码(该区域未开 email)

## 未完成

- 未在 iOS/Android 模拟器或真机走完:输入邮箱 → 弹出安全验证 → 通过 → 邮箱收到 6 位码
- CLI 过不了 Turnstile,不能代替 App 内发码

## 错误修复

#3147 按错误根因提了 discovery 过滤 + 补错误文案,独立审查认为修不了「验证码发出去」,已关闭。

下一步应查移动端 captcha 闸:`ensureCaptchaGate` / `LoginCaptchaWebView` 是否在自动串发路径弹出并拿到 token。

Contributor guide

Open the contributing guide

Research direction

Start with the mobile authentication path around ensureCaptchaGate and LoginCaptchaWebView. Run the email-login flow on an iOS or Android simulator or device: enter an email, complete Turnstile, and verify that the six-digit code is sent. Done means the captcha appears in the automatic request-code path, its token is accepted, and failures show a specific security-verification message.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
authentication, mobile, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.