fix: redirect query set to undefined due to missing if statement check
This commit is contained in:
parent
e6bff0042d
commit
6548f9329e
1 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,8 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||||
const { refresh } = useAuth();
|
const { refresh } = useAuth();
|
||||||
console.log("hi");
|
console.log("hi");
|
||||||
await refresh();
|
await refresh();
|
||||||
return await navigateTo("/login");
|
const query = new URLSearchParams();
|
||||||
|
query.set("redirect_to", to.path);
|
||||||
|
return await navigateTo("/login" + (query ?? ""));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue