From c0f688479f4978c647f8e6b4ab921ac220e579b3 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 1 Feb 2024 12:28:27 +0200 Subject: [PATCH] Add confirm password --- client/src/views/SettingsView.vue | 41 ++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/client/src/views/SettingsView.vue b/client/src/views/SettingsView.vue index 0445acff..62211b75 100644 --- a/client/src/views/SettingsView.vue +++ b/client/src/views/SettingsView.vue @@ -9,18 +9,35 @@ + + + + @@ -49,8 +66,12 @@ import { useAsyncState } from '@vueuse/core' export default defineComponent({ setup() { const form = ref() + const show_old = ref(false) + const show_new = ref(false) + const show_confirm = ref(false) const old_password = ref('') const new_password = ref('') + const confirm_password = ref('') const { execute, isLoading } = useAsyncState( async () => { @@ -63,13 +84,25 @@ export default defineComponent({ { immediate: false } ) + const confirmPassword = () => new_password.value == confirm_password.value || "Passwords should match." + + const validateForm = () => { + form.value?.validate() + } + return { form, + show_old, + show_new, old_password, new_password, + show_confirm, + confirm_password, passwordRules, isLoading, - execute + execute, + confirmPassword, + validateForm } } })