From aa12bffcbc09dfb9070a92232400c0d103d45c51 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:33:49 +0100 Subject: [PATCH] feat: replace password comparison with password toggle --- src/views/user/Register.vue | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index a3a74da74..dbe5d4827 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -53,33 +53,20 @@ name="password" :placeholder="$t('user.auth.passwordPlaceholder')" required - type="password" + :type="passwordFieldType" autocomplete="new-password" v-model="credentials.password" @keyup.enter="submit" @focusout="validatePassword" /> + + +

{{ $t('user.auth.passwordRequired') }}

-
- -
- -
-
@@ -157,6 +144,13 @@ const everythingValid = computed(() => { passwordValid.value }) +const passwordFieldType = ref('password') +const togglePasswordFieldType = () => { + passwordFieldType.value = passwordFieldType.value === 'password' + ? 'text' + : 'password' +} + async function submit() { errorMessage.value = '' @@ -171,3 +165,12 @@ async function submit() { } } + +