redis icon indicating copy to clipboard operation
redis copied to clipboard

Oauth2 refreshes the access_token problem when the refresh_token is not modified

Open hangyan2016 opened this issue 4 years ago • 0 comments

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)
}

hangyan2016 avatar Oct 29 '21 03:10 hangyan2016