mirror of
https://github.com/nais/wonderwall.git
synced 2026-08-23 21:16:14 +00:00
fix(handler/autologin): return http 303 for autologin redirects
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user