mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Include URL query in login redirects (#3305)
This commit is contained in:
parent
01d40c1b9e
commit
639a9da65b
2 changed files with 10 additions and 5 deletions
|
|
@ -85,12 +85,16 @@ func authenticateHandler() func(http.Handler) http.Handler {
|
||||||
prefix := getProxyPrefix(r.Header)
|
prefix := getProxyPrefix(r.Header)
|
||||||
|
|
||||||
// otherwise redirect to the login page
|
// otherwise redirect to the login page
|
||||||
u := url.URL{
|
returnURL := url.URL{
|
||||||
Path: prefix + "/login",
|
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)
|
http.Redirect(w, r, u.String(), http.StatusFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
* Changed performer aliases to be a list, rather than a string field. ([#3113](https://github.com/stashapp/stash/pull/3113))
|
* Changed performer aliases to be a list, rather than a string field. ([#3113](https://github.com/stashapp/stash/pull/3113))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 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 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 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))
|
* Fixed incorrect new Performer pill being removed when creating Performer from scrape dialog. ([#3251](https://github.com/stashapp/stash/pull/3251))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue