Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Commit

Permalink
fix context problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hiendv committed Nov 20, 2017
1 parent bc03573 commit ca724ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ type Provider interface {
}

type DefaultProvider struct {
*oauth2.Config
config *oauth2.Config
}

func (provider DefaultProvider) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string {
return provider.config.AuthCodeURL(state, opts...)
}

func (provider DefaultProvider) Exchange(ctx context.Context, code string) (*oauth2.Token, error) {
return provider.config.Exchange(ctx, code)
}

func (provider DefaultProvider) Client(ctx context.Context, t *oauth2.Token) internal.HTTPClient {
return provider.Config.Client(ctx, t)
return provider.config.Client(ctx, t)
}

// LoginFuncStub is the stub for LoginFunc
Expand Down

0 comments on commit ca724ca

Please sign in to comment.