mirror of
https://gh-proxy.org/https://github.com/klinsmaya/sub2api.git
synced 2026-11-08 16:47:08 +08:00
当前 OIDC 首次登录无条件创建 choose_account_action_required 的 pending session,即使 force_email_on_third_party_signup 关闭,前端仍然会强制 弹出"创建账号 / 绑定已有账号"的二选一界面,并展示内部合成邮箱 ([email protected]),用户体验差。 本次复用已存在的 LoginOrRegisterVerifiedEmailOAuth 路径(原本仅供 github/google 使用),在以下条件全部满足时跳过 choice 页,直接 信任上游身份完成注册/登录: - force_email_on_third_party_signup = false - 邀请码模式未启用 - 上游声明 email_verified = true 且 compat_email 非空 - 本地不存在同邮箱已有账号 失败时(如邮箱后缀不在白名单、注册关闭等)自动回退到现有 choice 流程,行为完全向后兼容。 测试覆盖: - TestTryOIDCVerifiedEmailFastPathCreatesUserAndIdentity - TestTryOIDCVerifiedEmailFastPathSkippedWhenInvitationCodeRequired - TestTryOIDCVerifiedEmailFastPathSkippedWhenForceEmailEnabled