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"
if req.URL.Scheme != "" {
scheme = req.URL.Scheme
if req.TLS != nil {
scheme = "https"
}
host := "localhost"
if req.URL.Host != "" {
host = req.URL.Host
if req.Host != "" {
host = req.Host
}
provider.RedirectURL = fmt.Sprintf("%s://%s/oauth/providers/%s/callback", scheme, host, providerName)
url := provider.AuthCodeURL(loginRequest.Id)