1
0
Fork 0
mirror of synced 2024-07-29 10:05:55 +12:00

Use ?params

This commit is contained in:
Adria Navarro 2023-12-18 10:59:33 +01:00
parent 13f80ad735
commit c80504ca93
2 changed files with 4 additions and 5 deletions

View file

@ -53,7 +53,7 @@ export const API = createAPIClient({
}
get(navigation).goto(
`${updatingUrl}?returnUrl=${encodeURIComponent(window.location)}`
`${updatingUrl}?returnUrl=${encodeURIComponent(window.location.pathname)}`
)
},
})

View file

@ -1,6 +1,6 @@
<script>
import Spinner from "components/common/Spinner.svelte"
import { redirect } from "@roxi/routify"
import { redirect, params } from "@roxi/routify"
import { API } from "api"
@ -18,9 +18,8 @@
return migrationTimeout()
}
const urlParams = new URLSearchParams(window.location.search)
const returnUrl = urlParams.get("returnUrl")
// For some reason routify params is not stripping the ? properly, so we need to check both with and without ?
const returnUrl = $params.returnUrl || $params["?returnUrl"]
$redirect(returnUrl)
}, 1000)
}