fix: access token will expired after 24h #1988
Merged
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.
这里在登录后生成了两个token:access_token、refresh_access;
access_token有效期是24h,refresh_token有效期是7天,理论上只要refresh_token有效,即使access_token过期了也应该重新生成新的access_token,但是目前的实现先判断了access_token的有效,如果无效就直接返回401了,就导致只要超过24h就需要重新登陆。
改为取消对于access_token有效期的判断,只有refresh_token也失效了才返回401;