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 23:51:39 +08:00
2026-04-25 20:39:58 -04:00
2026-05-21 13:32:20 +08:00
2026-02-08 12:05:39 +08:00
2026-02-08 12:05:39 +08:00
2026-03-27 14:33:05 +08:00
2026-05-17 15:01:17 -05:00
2026-05-20 15:48:38 +08:00
2026-05-21 11:31:05 +08:00
2026-05-21 10:39:46 +08:00
2026-05-21 13:32:20 +08:00
2026-03-17 15:38:18 +08:00
2026-03-09 19:55:18 +08:00
2026-04-05 17:11:01 +08:00
2026-04-23 15:13:57 +00:00