Skip to content

Commit

Permalink
enhance: credentials: update ApplicationCredentials.Exchange()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Oct 15, 2021
1 parent 5e00dd9 commit 5d09f8a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions credentials/credentials_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5d09f8a

Please sign in to comment.