From 9c344a0a95c44ef9cebade7b8a65ac160d9eb900 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sat, 11 Feb 2017 20:20:35 +0000 Subject: Revert "Remove the oauth_callback_url config option" --- server/auth/provider.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'server/auth/provider.go') diff --git a/server/auth/provider.go b/server/auth/provider.go index d4a8e58..06dc1c9 100644 --- a/server/auth/provider.go +++ b/server/auth/provider.go @@ -1,16 +1,11 @@ package auth -import ( - "fmt" - "net/http" - - "golang.org/x/oauth2" -) +import "golang.org/x/oauth2" // Provider is an abstraction of different auth methods. type Provider interface { Name() string - StartSession(string, *http.Request) *Session + StartSession(string) *Session Exchange(string) (*oauth2.Token, error) Username(*oauth2.Token) string Valid(*oauth2.Token) bool @@ -33,12 +28,3 @@ func (s *Session) Authorize(provider Provider, code string) error { s.Token = t return nil } - -// Oauth2RedirectURL returns an OAuth redirect_uri for this request. -func Oauth2RedirectURL(r *http.Request) string { - protocol := "http" - if r.TLS != nil { - protocol = "https" - } - return fmt.Sprintf("%s://%s/auth/callback", protocol, r.Host) -} -- cgit v1.2.3