Skip to content

Commit

Permalink
Get request info differently
Browse files Browse the repository at this point in the history
  • Loading branch information
xetorthio committed Oct 4, 2017
1 parent 4c03481 commit 97958f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions handlers/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 97958f2

Please sign in to comment.