fix: redirect query set to undefined due to missing if statement check

This commit is contained in:
SauceyRed 2025-05-28 22:38:11 +02:00
parent e6bff0042d
commit 6548f9329e
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462

View file

@ -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 ?? ""));
} }
}) })