Get request info differently

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-10-04 16:57:46 -03:00
parent 4c034812d2
commit 97958f2e30

View File

@@ -43,12 +43,12 @@ func Login(rw http.ResponseWriter, req *http.Request) {
} }
scheme := "http" scheme := "http"
if req.URL.Scheme != "" { if req.TLS != nil {
scheme = req.URL.Scheme scheme = "https"
} }
host := "localhost" host := "localhost"
if req.URL.Host != "" { if req.Host != "" {
host = req.URL.Host host = req.Host
} }
provider.RedirectURL = fmt.Sprintf("%s://%s/oauth/providers/%s/callback", scheme, host, providerName) provider.RedirectURL = fmt.Sprintf("%s://%s/oauth/providers/%s/callback", scheme, host, providerName)
url := provider.AuthCodeURL(loginRequest.Id) url := provider.AuthCodeURL(loginRequest.Id)