Skip to content

token 刷新后token无效了 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bluceyee opened this issue Jul 12, 2022 · 0 comments
Open

token 刷新后token无效了 #1

bluceyee opened this issue Jul 12, 2022 · 0 comments

Comments

@bluceyee
Copy link

目前代码中实现了token刷新,但是刷新后的token并没有返回给客户端,导致下次请求时发生token无效

// 检查缓存的token是否有效且自动刷新缓存token
func (m *GfToken) IsEffective(ctx context.Context, token string) bool {
cacheToken, key, err := m.getTokenData(ctx, token)
if err != nil {
g.Log().Info(ctx, err)
return false
}
_, code := m.IsNotExpired(cacheToken.JwtToken)
if JwtTokenOK == code {
// 刷新缓存
if m.IsRefresh(cacheToken.JwtToken) {
return m.doRefresh(ctx, key, cacheToken)
}
return true
}
return false
}

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

No branches or pull requests

1 participant