Include URL query in login redirects (#3305)

This commit is contained in:
DingDongSoLong4 2023-01-09 02:13:42 +02:00 committed by GitHub
parent 01d40c1b9e
commit 639a9da65b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -85,12 +85,16 @@ func authenticateHandler() func(http.Handler) http.Handler {
prefix := getProxyPrefix(r.Header)
// otherwise redirect to the login page
returnURL := url.URL{
Path: prefix + r.URL.Path,
RawQuery: r.URL.RawQuery,
}
q := make(url.Values)
q.Set(returnURLParam, returnURL.String())
u := url.URL{
Path: prefix + "/login",
RawQuery: q.Encode(),
}
q := u.Query()
q.Set(returnURLParam, prefix+r.URL.Path)
u.RawQuery = q.Encode()
http.Redirect(w, r, u.String(), http.StatusFound)
return
}

View file

@ -11,6 +11,7 @@
* Changed performer aliases to be a list, rather than a string field. ([#3113](https://github.com/stashapp/stash/pull/3113))
### 🐛 Bug fixes
* Fixed URL not being preserved when redirected to login. ([#3305](https://github.com/stashapp/stash/pull/3305))
* Fixed scene previews not being overwritten when Overwrite option is selected. ([#3256](https://github.com/stashapp/stash/pull/3256))
* Fixed objects without titles not being sorted correctly with objects with titles. ([#3244](https://github.com/stashapp/stash/pull/3244))
* Fixed incorrect new Performer pill being removed when creating Performer from scrape dialog. ([#3251](https://github.com/stashapp/stash/pull/3251))