aboutsummaryrefslogtreecommitdiff
path: root/server/auth/google/google.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/auth/google/google.go')
-rw-r--r--server/auth/google/google.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/auth/google/google.go b/server/auth/google/google.go
index 8c6f53b..305b6f4 100644
--- a/server/auth/google/google.go
+++ b/server/auth/google/google.go
@@ -43,7 +43,6 @@ func New(c *config.Auth) (*Config, error) {
config: &oauth2.Config{
ClientID: c.OauthClientID,
ClientSecret: c.OauthClientSecret,
- RedirectURL: c.OauthCallbackURL,
Endpoint: google.Endpoint,
Scopes: []string{googleapi.UserinfoEmailScope, googleapi.UserinfoProfileScope},
},
@@ -101,7 +100,8 @@ func (c *Config) Revoke(token *oauth2.Token) error {
}
// StartSession retrieves an authentication endpoint from Google.
-func (c *Config) StartSession(state string) *auth.Session {
+func (c *Config) StartSession(state string, r *http.Request) *auth.Session {
+ c.config.RedirectURL = auth.Oauth2RedirectURL(r)
return &auth.Session{
AuthURL: c.config.AuthCodeURL(state, oauth2.SetAuthURLParam("hd", c.domain)),
}