Skip to content

Commit b6d4c62

Browse files
authored
Fix oauth2Config.Exchange error reporting (#3003)
1 parent bf733f3 commit b6d4c62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/auth/idp/oauth2/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ func (client *Provider) VerifyIdentity(ctx context.Context, code, state, roleARN
323323
getWebTokenExpiry := func() (*credentials.WebIdentityToken, error) {
324324
customCtx := context.WithValue(ctx, oauth2.HTTPClient, client.provHTTPClient)
325325
oauth2Token, err := client.oauth2Config.Exchange(customCtx, code)
326-
client.RefreshToken = oauth2Token.RefreshToken
327326
if err != nil {
328327
return nil, err
329328
}
330329
if !oauth2Token.Valid() {
331330
return nil, errors.New("invalid token")
332331
}
332+
client.RefreshToken = oauth2Token.RefreshToken
333333

334334
expiration := token.GetConsoleSTSDuration()
335335
if exp := getIDPTokenExpiration(); exp > 0 {

0 commit comments

Comments
 (0)