Skip to content

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

Description

@hangyan2016

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions