Skip to content
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

Oauth2 refreshes the access_token problem when the refresh_token is not modified #13

Open
hangyan2016 opened this issue Oct 29, 2021 · 0 comments

Comments

@hangyan2016
Copy link

hangyan2016 commented Oct 29, 2021

When Oauth2 does not modify the refresh_token, it will continue to refresh the access_token, and the data in redis will continue to increase. Although these data have TTL, if the amount of data is large, there will be certain problems.

The problem can be solved by the following code.

iresult := s.cli.Get(s.wrapperKey(checkToken))
if err := iresult.Err(); err != nil && err != redis.Nil {
	return err
} else if iresult.Val() == "" || iresult.Val() != basicID {
	return s.remove(basicID)
}
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