diff options
author | Tuomo Ala-Vannesluoma <tuomoav@gmail.com> | 2018-08-12 12:36:10 +0300 |
---|---|---|
committer | Tuomo Ala-Vannesluoma <tuomoav@gmail.com> | 2018-08-12 12:36:10 +0300 |
commit | 1966ab9bf8592a32a7ff88e1d1439ed80f7f65bb (patch) | |
tree | 67050bfeab8865fd3b4db2746fa403932157c992 /internal/auth | |
parent | 3425634584820837fd88d14b944bbdc391823936 (diff) |
Use reserved namespace 'projects' for the redirect uri to handle situation where root pages domain is not handled with pages daemon
Diffstat (limited to 'internal/auth')
-rw-r--r-- | internal/auth/auth.go | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |