fix: 修复自动登出问题并优化登录注册体验 - #130
Merged
Merged
Conversation
后端: - 延长 access token 默认有效期至 7 天(原 24 小时) - 延长 refresh token 默认有效期至 90 天(原 30 天) - 刷新令牌时滚动更新 refresh_expires_at,持续使用不过期 前端: - 注册页 3 步向导合并为单页表单,减少两次点击 - 登录时用户名不存在改为友好提示并引导注册
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
改动内容
修复自动登出(后端)
核心问题:
refreshAccessToken()在轮换令牌时从未更新refresh_expires_at,导致无论用户多活跃,初次登录 30 天后必定被强制登出。修复:
refresh_expires_at(当前时间 + refresh token 有效期),只要持续使用就不会过期优化登录注册 UX(前端)
涉及文件
apps/api/src/services/auth/tokenService.jsapps/web/src/pages/app/account/register/index.vueapps/web/src/composables/useSignInFlow.jsapps/web/src/components/account/SignInFlow.vue测试建议