diff --git a/layouts/auth.vue b/layouts/auth.vue
index 95eca49..5d44793 100644
--- a/layouts/auth.vue
+++ b/layouts/auth.vue
@@ -18,6 +18,7 @@
Instance URL is set to
{{ instanceUrl }}
@@ -36,6 +37,12 @@ const apiVersion = useRuntimeConfig().public.apiVersion;
const apiBase = useCookie("api_base");
const registrationEnabled = useState("registrationEnabled", () => true);
+const query = useRoute().query as Record
;
+const searchParams = new URLSearchParams(query);
+searchParams.delete("token");
+
+const resetPasswordUrl = `/reset-password?${searchParams}`;
+
const auth = useAuth();
onMounted(async () => {
@@ -111,6 +118,7 @@ const form = reactive({
#auth-form-container form {
display: flex;
flex-direction: column;
+ align-items: center;
text-align: left;
margin-top: 10dvh;
gap: 1em;
diff --git a/middleware/auth.global.ts b/middleware/auth.global.ts
index c0da664..4fdfead 100644
--- a/middleware/auth.global.ts
+++ b/middleware/auth.global.ts
@@ -16,7 +16,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
}
}
- if (["/login", "/register"].includes(to.path) && !Object.keys(to.query).includes("special")) {
+ if (["/login", "/register", "/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/login.vue b/pages/login.vue
index 03078c3..7b3c23a 100644
--- a/pages/login.vue
+++ b/pages/login.vue
@@ -38,6 +38,7 @@ const form = reactive({
const query = useRoute().query as Record;
const searchParams = new URLSearchParams(query);
+searchParams.delete("token");
const registrationEnabled = ref(true);
const apiBase = useCookie("api_base");
@@ -50,7 +51,7 @@ if (apiBase.value) {
}
}
-const registerUrl = `/register?${searchParams}`
+const registerUrl = `/register?${searchParams}`;
const { login } = useAuth();
diff --git a/pages/register.vue b/pages/register.vue
index 708fed0..36bdb53 100644
--- a/pages/register.vue
+++ b/pages/register.vue
@@ -86,6 +86,7 @@ const auth = useAuth();
const loggedIn = ref(await auth.getUser());
const query = new URLSearchParams(useRoute().query as Record);
+query.delete("token");
const user = await useAuth().getUser();
diff --git a/pages/reset-password.vue b/pages/reset-password.vue
new file mode 100644
index 0000000..f579fc5
--- /dev/null
+++ b/pages/reset-password.vue
@@ -0,0 +1,103 @@
+
+
+ {{ errorValue }}
+
+
+
+ If an account with that username/email exists, an email will be sent to it shortly.
+
+
+
+
+ Don't have an account? Register one!
+
+
+ Already have an account? Log in!
+
+
+
+
+
+
+
\ No newline at end of file