From 1966ab9bf8592a32a7ff88e1d1439ed80f7f65bb Mon Sep 17 00:00:00 2001 From: Tuomo Ala-Vannesluoma Date: Sun, 12 Aug 2018 12:36:10 +0300 Subject: Use reserved namespace 'projects' for the redirect uri to handle situation where root pages domain is not handled with pages daemon --- internal/auth/auth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal') diff --git a/internal/auth/auth.go b/internal/auth/auth.go index d3701207..936754cc 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -24,7 +24,7 @@ const ( tokenURLTemplate = "%s/oauth/token" tokenContentTemplate = "client_id=%s&client_secret=%s&code=%s&grant_type=authorization_code&redirect_uri=%s" callbackPath = "/auth" - authorizeProxyTemplate = "%s/auth?domain=%s&state=%s" + authorizeProxyTemplate = "%s?domain=%s&state=%s" ) // Auth handles authenticating users with GitLab API @@ -308,9 +308,9 @@ func (a *Auth) checkTokenExists(session *sessions.Session, w http.ResponseWriter func (a *Auth) getProxyAddress(r *http.Request, state string) string { if r.TLS != nil { - return fmt.Sprintf(authorizeProxyTemplate, "https://"+a.pagesDomain, r.Host, state) + return fmt.Sprintf(authorizeProxyTemplate, a.redirectURI, r.Host, state) } - return fmt.Sprintf(authorizeProxyTemplate, "http://"+a.pagesDomain, r.Host, state) + return fmt.Sprintf(authorizeProxyTemplate, a.redirectURI, r.Host, state) } func destroySession(session *sessions.Session, w http.ResponseWriter, r *http.Request) { -- cgit v1.2.3