Repository navigation
fix: 避免登录成功后 X-User-Token 被登录页再次清掉 - #166
Merged
Merged
Conversation
Login 清 token 的 effect 依赖了每次 render 新建的 storeKeys,会在写入 token 后被清掉;登录请求忽略 401 整页跳转,referer 若仍是登录页则回首页。 Co-authored-by: Cursor <cursoragent@cursor.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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
storeKeys引用变化在写入后再次removeTokenignoreState: true,避免登录接口 401 触发整页跳转referer若仍是登录页则回首页,避免登录成功又回到登录页把 token 清掉Version
1.1.90 → 1.1.91
Test plan
X-User-Token仍在,后续请求带上该 headerreferer=/account/login登录后应进入首页而不是留在登录页Made with Cursor