feat(auth): 注销账号——App 内删除账号及云端全部数据(App Store 5.1.1(v)) - #709
Merged
Conversation
App Store 审核指南 5.1.1(v):支持注册的 App 必须在 App 内提供删除账号。手机端 验证码登录即建号,却一直没有删除入口——2026-09-02 两端因 Guideline 2.1 被退回时 点名了这一条("Account deletion is required in apps that support account creation")。 新增 POST /api/auth/account/delete(需 X-Session-Id)与 AccountDeletionService, 按用户清空:中转区影像(先删 blob 再删行)、项目目录镜像、设备心跳、传输请求、 会话、账号绑定、设备令牌,最后删 app_users 行。 **不碰手机本地的影像。** 这是取证工具,现场不可复现,替用户把本地原图一并销毁 不是「清理」而是毁证。注销只清云端,本地留在设备上由用户自己决定——客户端的确认 弹窗把这一点写明了。 顺带把 accountDeletionService 放在 AuthController 构造器**末尾**:插在中间会让 14 个直接 new 出来的测试调用点全部位移错位(上次加 ReviewAccountGate 就是这么 踩的),放末尾则补一个参数即可。 自验证(JDK 21,与 CI 同版本):55 个测试全过,含 4 条新增——该删的一样不落、 已投递件没 blob 不去删空路径、blob 删不掉不能把账号删一半、查无此人回业务错不是 500。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
为什么
2026-09-02 两个 iOS App 因 Guideline 2.1 被退回。信里 6 条要求中 5 条是文字答复,
只有一条要改代码:
手机端验证码登录即建号(
findOrCreateByPhone/findOrCreateByEmail),却没有删除入口——这是审核指南 5.1.1(v) 的硬要求。
改了什么
POST /api/auth/account/delete(需X-Session-Id)+AccountDeletionService,按用户清空云端全部数据:
blobStore.deleteQuietly)再删行app_users不碰手机本地的影像。 取证工具,现场不可复现——替用户销毁本地原图不是清理是毁证。
注销只清云端,客户端确认弹窗把这一点写明。
一处避坑
accountDeletionService放在AuthController构造器末尾而不是中间:插在中间会让 14 个直接
new AuthController(...)的测试调用点全部位移错位(上次加ReviewAccountGate正是这么踩的,报一堆incompatible types)。自验证
JDK 21(与 CI 同版本):55 个测试全过,含 4 条新增:
iOS 侧在模拟器实跑确认:设置页「注销账号」在退出登录下方、字重更轻,弹窗写明
「删云端 / 不删本地」,破坏性按钮为红色。
相关 dev-board#345 / #346。
🤖 Generated with Claude Code