From b7f001132e78beb3daff5deb1770f9e8a21dc268 Mon Sep 17 00:00:00 2001 From: "Jeffrey N. Johnson" Date: Mon, 9 Dec 2024 10:26:05 -0800 Subject: [PATCH] Reauthenticating upon inactive Globus token error. --- endpoints/globus/endpoint.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/endpoints/globus/endpoint.go b/endpoints/globus/endpoint.go index e73c046b..fb946cf8 100644 --- a/endpoints/globus/endpoint.go +++ b/endpoints/globus/endpoint.go @@ -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 {