From 6658c28c856236a7e32648335b628cbda65d91d9 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 29 May 2025 04:09:44 +0200 Subject: [PATCH 1/5] feat: add utility to scroll to bottom of element --- utils/scrollToBottom.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 utils/scrollToBottom.ts diff --git a/utils/scrollToBottom.ts b/utils/scrollToBottom.ts new file mode 100644 index 0000000..aca99b4 --- /dev/null +++ b/utils/scrollToBottom.ts @@ -0,0 +1,6 @@ +export default (element: Ref) => { + if (element.value) { + element.value.scrollTo({ top: element.value.scrollHeight }); + return; + } +} From 25fc9e23c5d6ced6ea41a137c0843c901fac8ce2 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 29 May 2025 04:11:03 +0200 Subject: [PATCH 2/5] fix: redirect missing ? before query parameters --- middleware/auth.global.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/auth.global.ts b/middleware/auth.global.ts index 0fc6765..613e928 100644 --- a/middleware/auth.global.ts +++ b/middleware/auth.global.ts @@ -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 ?? "")); } }) From 52eab190ee059728eb52627381ba443bb0ea947b Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 29 May 2025 04:12:13 +0200 Subject: [PATCH 3/5] fix: auth layout causing too much recursion due to having forgotten to remove --- layouts/auth.vue | 80 +++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/layouts/auth.vue b/layouts/auth.vue index a395a7c..356dcd5 100644 --- a/layouts/auth.vue +++ b/layouts/auth.vue @@ -1,50 +1,48 @@