ye4241
39fe7aa0eb
feat(oidc): 上游邮箱已验证时跳过 choice 页直接登录注册
当前 OIDC 首次登录无条件创建 choose_account_action_required 的 pending
session,即使 force_email_on_third_party_signup 关闭,前端仍然会强制
弹出"创建账号 / 绑定已有账号"的二选一界面,并展示内部合成邮箱
(oidc-xxx@oidc-connect.invalid),用户体验差。
本次复用已存在的 LoginOrRegisterVerifiedEmailOAuth 路径(原本仅供
github/google 使用),在以下条件全部满足时跳过 choice 页,直接
信任上游身份完成注册/登录:
- force_email_on_third_party_signup = false
- 邀请码模式未启用
- 上游声明 email_verified = true 且 compat_email 非空
- 本地不存在同邮箱已有账号
失败时(如邮箱后缀不在白名单、注册关闭等)自动回退到现有 choice
流程,行为完全向后兼容。
测试覆盖:
- TestTryOIDCVerifiedEmailFastPathCreatesUserAndIdentity
- TestTryOIDCVerifiedEmailFastPathSkippedWhenInvitationCodeRequired
- TestTryOIDCVerifiedEmailFastPathSkippedWhenForceEmailEnabled
2026-05-21 13:32:20 +08:00
..
2026-05-20 09:11:41 +00:00
2026-05-19 22:05:43 +08:00
2026-05-21 13:32:20 +08:00
2026-05-21 00:48:38 +08:00
2026-05-12 09:26:53 +00:00
2026-01-11 23:00:31 +08:00
2026-03-07 15:17:16 +08:00
2026-05-08 14:42:20 +08:00
2026-05-08 14:42:20 +08:00
2026-05-20 11:09:18 +08:00
2026-02-28 15:01:20 +08:00