fix: redirect missing ? before query parameters

This commit is contained in:
SauceyRed 2025-05-29 04:11:03 +02:00
parent 6658c28c85
commit 25fc9e23c5
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462

View file

@ -1,5 +1,5 @@
export default defineNuxtRouteMiddleware(async (to, from) => {
console.log("to.path:", to.path);
console.log("to.fullPath:", to.fullPath);
const loading = useState("loading");
const accessToken = useCookie("access_token").value;
if (["/login", "/register"].includes(to.path)) {
@ -19,6 +19,6 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
query.set("redirect_to", to.path);
loading.value = false;
console.log("set loading to false");
return await navigateTo("/login" + (query ?? ""));
return await navigateTo("/login?" + (query ?? ""));
}
})