diff options
Diffstat (limited to 'server/auth/google')
-rw-r--r-- | server/auth/google/google.go | 6 | ||||
-rw-r--r-- | server/auth/google/google_test.go | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/server/auth/google/google.go b/server/auth/google/google.go index 9a151f6..b707310 100644 --- a/server/auth/google/google.go +++ b/server/auth/google/google.go @@ -103,10 +103,8 @@ func (c *Config) Revoke(token *oauth2.Token) error { } // StartSession retrieves an authentication endpoint from Google. -func (c *Config) StartSession(state string) *auth.Session { - return &auth.Session{ - AuthURL: c.config.AuthCodeURL(state, oauth2.SetAuthURLParam("hd", c.domain)), - } +func (c *Config) StartSession(state string) string { + return c.config.AuthCodeURL(state, oauth2.SetAuthURLParam("hd", c.domain)) } // Exchange authorizes the session and returns an access token. diff --git a/server/auth/google/google_test.go b/server/auth/google/google_test.go index b3d2633..92e4ca0 100644 --- a/server/auth/google/google_test.go +++ b/server/auth/google/google_test.go @@ -57,10 +57,10 @@ func TestStartSession(t *testing.T) { p, err := newGoogle() a.NoError(err) s := p.StartSession("test_state") - a.Contains(s.AuthURL, "accounts.google.com/o/oauth2/auth") - a.Contains(s.AuthURL, "state=test_state") - a.Contains(s.AuthURL, fmt.Sprintf("hd=%s", domain)) - a.Contains(s.AuthURL, fmt.Sprintf("client_id=%s", oauthClientID)) + a.Contains(s, "accounts.google.com/o/oauth2/auth") + a.Contains(s, "state=test_state") + a.Contains(s, fmt.Sprintf("hd=%s", domain)) + a.Contains(s, fmt.Sprintf("client_id=%s", oauthClientID)) } func newGoogle() (*Config, error) { |