Skip to content

Commit

Permalink
Merge pull request moby#2062 from earthly/corey/fix-stale-tokens
Browse files Browse the repository at this point in the history
Remove potentially expired tokens
  • Loading branch information
tonistiigi authored Apr 26, 2021
2 parents f113b49 + 9b7a5fc commit aa8c1ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/resolver/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ func (ah *authHandler) fetchToken(ctx context.Context, sm *session.Manager, g se
}

func invalidAuthorization(c auth.Challenge, responses []*http.Response) error {
lastResponse := responses[len(responses)-1]
if lastResponse.StatusCode == http.StatusUnauthorized {
return errors.Wrapf(docker.ErrInvalidAuthorization, "authorization status: %v", lastResponse.StatusCode)
}

errStr := c.Parameters["error"]
if errStr == "" {
return nil
Expand Down

0 comments on commit aa8c1ba

Please sign in to comment.