aboutsummaryrefslogtreecommitdiff
path: root/server/auth/gitlab/gitlab.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2017-02-11 20:20:35 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-02-11 20:20:35 +0000
commit9c344a0a95c44ef9cebade7b8a65ac160d9eb900 (patch)
treeaa3782547656b26a55527295c78aa0b8621f8676 /server/auth/gitlab/gitlab.go
parent376b8f670a9c80e8ae69581a354cb989571c44c2 (diff)
Revert "Remove the oauth_callback_url config option"
Diffstat (limited to 'server/auth/gitlab/gitlab.go')
-rw-r--r--server/auth/gitlab/gitlab.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/auth/gitlab/gitlab.go b/server/auth/gitlab/gitlab.go
index 27edafa..f76b2e8 100644
--- a/server/auth/gitlab/gitlab.go
+++ b/server/auth/gitlab/gitlab.go
@@ -2,7 +2,6 @@ package gitlab
import (
"errors"
- "net/http"
"strconv"
"github.com/nsheridan/cashier/server/auth"
@@ -52,6 +51,7 @@ func New(c *config.Auth) (*Config, error) {
config: &oauth2.Config{
ClientID: c.OauthClientID,
ClientSecret: c.OauthClientSecret,
+ RedirectURL: c.OauthCallbackURL,
Endpoint: oauth2.Endpoint{
AuthURL: siteURL + "oauth/authorize",
TokenURL: siteURL + "oauth/token",
@@ -110,8 +110,7 @@ func (c *Config) Revoke(token *oauth2.Token) error {
}
// StartSession retrieves an authentication endpoint from Gitlab.
-func (c *Config) StartSession(state string, r *http.Request) *auth.Session {
- c.config.RedirectURL = auth.Oauth2RedirectURL(r)
+func (c *Config) StartSession(state string) *auth.Session {
return &auth.Session{
AuthURL: c.config.AuthCodeURL(state),
}