fix(handler/autologin): return http 303 for autologin redirects

This commit is contained in:
Trong Huu Nguyen
2022-09-09 14:38:46 +02:00
parent a4ceaeaacc
commit fcc6a7472c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -371,7 +371,7 @@ func TestHandler_Default(t *testing.T) {
target := idp.RelyingPartyServer.URL + "/"
resp := get(t, rpClient, target)
assert.Equal(t, http.StatusTemporaryRedirect, resp.StatusCode)
assert.Equal(t, http.StatusSeeOther, resp.StatusCode)
// redirect should point to local login endpoint
loginLocation := resp.Location
@@ -480,7 +480,7 @@ func TestHandler_Default(t *testing.T) {
target := idp.RelyingPartyServer.URL + path
resp := get(t, rpClient, target)
assert.Equal(t, http.StatusTemporaryRedirect, resp.StatusCode)
assert.Equal(t, http.StatusSeeOther, resp.StatusCode)
})
}
})
+1 -1
View File
@@ -86,7 +86,7 @@ func (rp *ReverseProxy) Handler(src Source, w http.ResponseWriter, r *http.Reque
path := src.GetPath(r)
loginUrl := url.LoginURL(path, redirectTarget)
http.Redirect(w, r, loginUrl, http.StatusTemporaryRedirect)
http.Redirect(w, r, loginUrl, http.StatusSeeOther)
return
}