|
|
@@ -140,10 +140,15 @@ const submitClick = async () => {
|
|
|
|
|
|
const params: any = router.currentRoute.value.query;
|
|
|
if ("redirect" in params && params.redirect) {
|
|
|
- const url = new URL(decodeURIComponent(params.redirect as string));
|
|
|
+ const rawRedirect = decodeURIComponent(params.redirect as string);
|
|
|
+ const outerUrl = new URL(rawRedirect, window.location.origin);
|
|
|
+ const nested = outerUrl.searchParams.get("redirect");
|
|
|
+ const finalRedirect = nested ? decodeURIComponent(nested) : rawRedirect;
|
|
|
+
|
|
|
+ const url = new URL(finalRedirect, window.location.origin);
|
|
|
url.searchParams.delete("token");
|
|
|
// url.searchParams.append("token", user.value.token);
|
|
|
- window.localStorage.setItem('token', user.value.token)
|
|
|
+ window.localStorage.setItem("token", user.value.token);
|
|
|
window.location.replace(url);
|
|
|
} else {
|
|
|
router.replace({ name: RouteName.dispatch });
|