Skip to content

补充自动恢复登录的数据归属检查 - #15

Open
reece00 wants to merge 1 commit into
TransmtfTeam:mainfrom
reece00:codex/auth-ownership-restore
Open

reece00 wants to merge 1 commit into
TransmtfTeam:mainfrom
reece00:codex/auth-ownership-restore

Conversation

@reece00

@reece00 reece00 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

背景信息

应用支持在页面启动时通过已有 Cookie 或 Refresh Token 自动恢复登录。此前这两条恢复路径没有执行本地数据归属检查,可能导致其他账号遗留的本地记录在用户确认前进入云同步流程。

修改内容

  • 为 Access Token 自动恢复登录补充数据归属检查。
  • 为 Refresh Token 静默恢复登录补充数据归属检查。
  • 在认证状态发布前设置归属保护标记,阻止同步模块抢先执行。

实现说明

  • src/contexts/AuthContext.tsx
    • 在恢复 Access Token 后设置认证状态前调用 updateDataOwnershipFlag
    • 在 Refresh Token 刷新成功后设置认证状态前调用 updateDataOwnershipFlag
    • 复用现有的数据归属确认流程,等待用户选择上传、清除或稍后处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant