Skip to content

Commit

Permalink
Reauthenticating upon inactive Globus token error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-cohere committed Dec 9, 2024
1 parent 439b66e commit b7f0011
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions endpoints/globus/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,9 @@ func (ep *Endpoint) sendRequest(request *http.Request) ([]byte, error) {
if err != nil {
return nil, err
}
if errResp.Code == "ConsentRequired" {
// we're missing a required scope, so reauthenticate with it
if errResp.Code == "ConsentRequired" || errResp.Code == "AuthenticationFailed" {
// our token has expired or we're missing a required scope,
// so reauthenticate
ep.Scopes = errResp.RequiredScopes
err = ep.authenticate()
if err != nil {
Expand Down

0 comments on commit b7f0011

Please sign in to comment.