Issue #1039 - Correct redirect to login page if dex authentication is not successful (#1040)

This commit is contained in:
Alexander Matyushentsev 2019-01-17 18:42:57 -08:00 committed by GitHub
parent cf486a480e
commit 8da5fd9bb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package dex
import (
"bytes"
"fmt"
"html"
"io/ioutil"
@ -44,6 +45,7 @@ func NewDexHTTPReverseProxy(serverAddr string) func(writer http.ResponseWriter,
resp.Header.Set("Content-Length", strconv.Itoa(0))
resp.Header.Set("Location", fmt.Sprintf("/login?sso_error=%s", url.QueryEscape(message)))
resp.StatusCode = http.StatusSeeOther
resp.Body = ioutil.NopCloser(bytes.NewReader(make([]byte, 0)))
return nil
}
return nil