Get request info differently
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user