From 5d09f8ad9a1569cd2fbcd892bb16c40ab4760364 Mon Sep 17 00:00:00 2001 From: John Wang Date: Fri, 15 Oct 2021 02:31:12 -0700 Subject: [PATCH] enhance: credentials: update `ApplicationCredentials.Exchange()` --- credentials/credentials_application.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/credentials/credentials_application.go b/credentials/credentials_application.go index 49536b8..8f3bed4 100644 --- a/credentials/credentials_application.go +++ b/credentials/credentials_application.go @@ -67,15 +67,13 @@ func (app *ApplicationCredentials) Exchange(code string) (*oauth2.Token, error) if app.AccessTokenTTL > 0 { authCodeOptions = append(authCodeOptions, oauth2.SetAuthURLParam("accessTokenTtl", strconv.Itoa(int(app.AccessTokenTTL)))) - //params.Set("accessTokenTtl", strconv.Itoa(int(app.AccessTokenTTL))) } if app.RefreshTokenTTL > 0 { authCodeOptions = append(authCodeOptions, oauth2.SetAuthURLParam("refreshTokenTtl", strconv.Itoa(int(app.RefreshTokenTTL)))) - //params.Set("refreshTokenTtl", strconv.Itoa(int(app.RefreshTokenTTL))) } - return cfg.Exchange(context.Background(), code) + return cfg.Exchange(context.Background(), code, authCodeOptions...) } func (ac *ApplicationCredentials) AppNameAndVersion() string {