forked from Mirrors/oauth2
Avoid returning non-existent errors.
This commit is contained in:
parent
6c54258546
commit
643fd905db
|
@ -123,8 +123,8 @@ func NewComputeEngineConfig(account string) (*ComputeEngineConfig, error) {
|
|||
}
|
||||
|
||||
// NewTransport creates an authorized transport.
|
||||
func (c *ComputeEngineConfig) NewTransport() (oauth2.Transport, error) {
|
||||
return oauth2.NewAuthorizedTransport(c, nil), nil
|
||||
func (c *ComputeEngineConfig) NewTransport() oauth2.Transport {
|
||||
return oauth2.NewAuthorizedTransport(c, nil)
|
||||
}
|
||||
|
||||
// FetchToken retrieves a new access token via metadata server.
|
||||
|
|
8
jwt.go
8
jwt.go
|
@ -75,14 +75,14 @@ func (c *JWTConfig) Options() *JWTOptions {
|
|||
|
||||
// NewTransport creates a transport that is authorize with the
|
||||
// parent JWT configuration.
|
||||
func (c *JWTConfig) NewTransport() (Transport, error) {
|
||||
return NewAuthorizedTransport(c, &Token{}), nil
|
||||
func (c *JWTConfig) NewTransport() Transport {
|
||||
return NewAuthorizedTransport(c, &Token{})
|
||||
}
|
||||
|
||||
// NewTransportWithUser creates a transport that is authorized by
|
||||
// the client and impersonates the specified user.
|
||||
func (c *JWTConfig) NewTransportWithUser(user string) (Transport, error) {
|
||||
return NewAuthorizedTransport(c, &Token{Subject: user}), nil
|
||||
func (c *JWTConfig) NewTransportWithUser(user string) Transport {
|
||||
return NewAuthorizedTransport(c, &Token{Subject: user})
|
||||
}
|
||||
|
||||
// fetchToken retrieves a new access token and updates the existing token
|
||||
|
|
|
@ -178,8 +178,8 @@ func (c *Config) AuthCodeURL(state string) (authURL string, err error) {
|
|||
// t, _ := c.NewTransport()
|
||||
// t.SetToken(validToken)
|
||||
//
|
||||
func (c *Config) NewTransport() (Transport, error) {
|
||||
return NewAuthorizedTransport(c, nil), nil
|
||||
func (c *Config) NewTransport() Transport {
|
||||
return NewAuthorizedTransport(c, nil)
|
||||
}
|
||||
|
||||
// NewTransportWithCode exchanges the OAuth 2.0 exchange code with
|
||||
|
|
Loading…
Reference in New Issue