From 491e736422c16aef9f6ce07086da739b29355a22 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Mon, 14 Jul 2025 22:27:30 +0200 Subject: [PATCH 1/6] feat: change Button component to be a button and not a div, and made callback optional --- components/UserInterface/Button.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/UserInterface/Button.vue b/components/UserInterface/Button.vue index 66706de..467b65e 100644 --- a/components/UserInterface/Button.vue +++ b/components/UserInterface/Button.vue @@ -1,14 +1,14 @@ + + \ No newline at end of file From db2a99736ac5937ec1207de6d137477705e23b01 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Wed, 16 Jul 2025 11:36:12 +0200 Subject: [PATCH 4/6] feat: separate password reset page into two, one for sending the email and one to change the password --- layouts/auth.vue | 10 ++--- middleware/auth.global.ts | 2 +- pages/recover.vue | 89 +++++++++++++++++++++++++++++++++++++++ pages/reset-password.vue | 81 ++++++----------------------------- 4 files changed, 108 insertions(+), 74 deletions(-) create mode 100644 pages/recover.vue diff --git a/layouts/auth.vue b/layouts/auth.vue index 5d44793..7d21f00 100644 --- a/layouts/auth.vue +++ b/layouts/auth.vue @@ -18,7 +18,7 @@
-
Forgot password? Recover here!
+
Forgot password? Recover here!
Instance URL is set to {{ instanceUrl }} @@ -37,14 +37,12 @@ const apiVersion = useRuntimeConfig().public.apiVersion; const apiBase = useCookie("api_base"); const registrationEnabled = useState("registrationEnabled", () => true); -const query = useRoute().query as Record; +const route = useRoute(); + +const query = route.query as Record; const searchParams = new URLSearchParams(query); searchParams.delete("token"); -const resetPasswordUrl = `/reset-password?${searchParams}`; - -const auth = useAuth(); - onMounted(async () => { instanceUrl.value = useCookie("instance_url").value; console.log("set instance url to:", instanceUrl.value); diff --git a/middleware/auth.global.ts b/middleware/auth.global.ts index 4fdfead..e6d5128 100644 --- a/middleware/auth.global.ts +++ b/middleware/auth.global.ts @@ -16,7 +16,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => { } } - if (["/login", "/register", "/reset-password"].includes(to.path) && !Object.keys(to.query).includes("special")) { + if (["/login", "/register", "/recover", "/reset-password"].includes(to.path) && !Object.keys(to.query).includes("special")) { console.log("path is login or register"); const apiBase = useCookie("api_base"); console.log("apiBase gotten:", apiBase.value); diff --git a/pages/recover.vue b/pages/recover.vue new file mode 100644 index 0000000..a886d87 --- /dev/null +++ b/pages/recover.vue @@ -0,0 +1,89 @@ + + + + + \ No newline at end of file diff --git a/pages/reset-password.vue b/pages/reset-password.vue index f579fc5..83e1f1f 100644 --- a/pages/reset-password.vue +++ b/pages/reset-password.vue @@ -1,50 +1,27 @@