From 8da5fd9bb7e8b071a9fc39cd18ed9fa305432e4f Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Thu, 17 Jan 2019 18:42:57 -0800 Subject: [PATCH] Issue #1039 - Correct redirect to login page if dex authentication is not successful (#1040) --- util/dex/dex.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/dex/dex.go b/util/dex/dex.go index 42f80cf153..c7a4426765 100644 --- a/util/dex/dex.go +++ b/util/dex/dex.go @@ -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