forked from Mirrors/oauth2
Avoid concatenating scope literals.
This commit is contained in:
parent
33dee1ee8d
commit
6d8f8ea9d2
|
@ -3,8 +3,6 @@
|
||||||
package google
|
package google
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/golang/oauth2"
|
"github.com/golang/oauth2"
|
||||||
|
|
||||||
"appengine"
|
"appengine"
|
||||||
|
@ -43,7 +41,7 @@ func (c *AppEngineConfig) NewTransport() oauth2.Transport {
|
||||||
|
|
||||||
// FetchToken fetches a new access token for the provided scopes.
|
// FetchToken fetches a new access token for the provided scopes.
|
||||||
func (c *AppEngineConfig) FetchToken(existing *oauth2.Token) (*oauth2.Token, error) {
|
func (c *AppEngineConfig) FetchToken(existing *oauth2.Token) (*oauth2.Token, error) {
|
||||||
token, expiry, err := appengine.AccessToken(c.context, strings.Join(c.scopes, " "))
|
token, expiry, err := appengine.AccessToken(c.context, c.scopes...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package google
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/golang/oauth2"
|
"github.com/golang/oauth2"
|
||||||
"google.golang.org/appengine"
|
"google.golang.org/appengine"
|
||||||
|
@ -31,7 +30,7 @@ func (c *AppEngineConfig) NewTransport() oauth2.Transport {
|
||||||
|
|
||||||
// FetchToken fetches a new access token for the provided scopes.
|
// FetchToken fetches a new access token for the provided scopes.
|
||||||
func (c *AppEngineConfig) FetchToken(existing *oauth2.Token) (*oauth2.Token, error) {
|
func (c *AppEngineConfig) FetchToken(existing *oauth2.Token) (*oauth2.Token, error) {
|
||||||
token, expiry, err := appengine.AccessToken(c.context, strings.Join(c.scopes, " "))
|
token, expiry, err := appengine.AccessToken(c.context, c.scopes...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue