1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

redirect to original path after login (#24)

* redirect to original path after login

* tests for new redirect behaviour

* fixed comment

* added redirect fix to changelog
This commit is contained in:
Steve Arch
2019-01-29 12:13:02 +00:00
committed by Joel Speed
parent 440d2f32bf
commit 090ff11923
3 changed files with 40 additions and 1 deletions

View File

@ -564,7 +564,10 @@ func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error)
redirect = req.Form.Get("rd")
if redirect == "" || !strings.HasPrefix(redirect, "/") || strings.HasPrefix(redirect, "//") {
redirect = "/"
redirect = req.URL.Path
if strings.HasPrefix(redirect, p.ProxyPrefix) {
redirect = "/"
}
}
return