fix(auth): OAuth 回调 fragment 去凭证化仅保留非敏感状态 - #80
Merged
Merged
Conversation
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.
What & why
修复 #63 / 矩阵 D-6:OAuth 成功回调把完整 access token 放进回跳前端的 URL fragment(
oauth.py的oauth_callback),对前端 JS、浏览器地址栏与 history 暴露凭证——同响应已下发 HttpOnly cookie,fragment 里的 token 纯属多余暴露面。provider+expires_at,凭证只经 HttpOnly cookie;oauth/callback/page.tsx):不再读取任何凭证类 fragment 参数,直接以 cookie 拉/auth/me判定登录态;旧版#token=...链接仍能落地但一律不消费(兼容行为);fragment 不含 token=、含provider与expires_at,cookie 照常下发。Refs #63。Closes #63。
Area
Verification
tests_oauth_patch/29 项全绿(含转正的 fragment 无凭证断言)npx tsc --noEmit通过;前端 147/147 通过applyAuthSession消费面核实:access_token仅作 truthy presence(setAuthToken('1')),占位值无行为差异Verifier verdict
CI 门禁即机器 Verifier;「fragment 无凭证」由 GitHub/Google 双 mock 回归独立钉死。真实 provider 端到端(含登出)留待有真实 OAuth 应用环境时人工回归——已在 #63 关闭评论中说明。
Checklist
issue-<number>-<short-slug>and PR links the issue