diff --git a/ui/v2.5/src/components/Changelog/versions/v050.md b/ui/v2.5/src/components/Changelog/versions/v050.md index 8037c6441..eaf07f18c 100644 --- a/ui/v2.5/src/components/Changelog/versions/v050.md +++ b/ui/v2.5/src/components/Changelog/versions/v050.md @@ -10,3 +10,6 @@ * Use natural sort for titles and movie names. * Support optional preview and sprite generation during scanning. * Support configurable number of threads for scanning and generation. + +### 🐛 Bug fixes +* Fixed login redirect to remember the current page. diff --git a/ui/v2.5/src/core/createClient.ts b/ui/v2.5/src/core/createClient.ts index c64e74fc1..0d40fbe15 100644 --- a/ui/v2.5/src/core/createClient.ts +++ b/ui/v2.5/src/core/createClient.ts @@ -113,7 +113,9 @@ export const createClient = () => { // handle unauthorized error by redirecting to the login page if (networkError && (networkError as ServerError).statusCode === 401) { // redirect to login page - window.location.href = "/login"; + const newURL = new URL("/login", window.location.toString()); + newURL.searchParams.append("returnURL", window.location.href); + window.location.href = newURL.toString(); } });