0
1
Fork 0

Change password form fields validation

This commit is contained in:
William Buezas 2024-07-26 08:54:11 -03:00
parent 7f831ae3a5
commit 06cd9b01d3
1 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,10 @@ const formData = ref({
}); });
const changePassword = async () => { const changePassword = async () => {
if (!formData.value.newPassword || !repeatPassword.value) {
notify(t('passwordEmpty'), 'negative');
throw new Error('Password empty');
}
if (formData.value.newPassword !== repeatPassword.value) { if (formData.value.newPassword !== repeatPassword.value) {
notify(t('passwordsDoNotMatch'), 'negative'); notify(t('passwordsDoNotMatch'), 'negative');
throw new Error('Passwords do not match'); throw new Error('Passwords do not match');
@ -143,6 +147,7 @@ en-US:
digits: '{nDigits} digits' digits: '{nDigits} digits'
symbols: '{nPunct} symbols. Ej: $%&.' symbols: '{nPunct} symbols. Ej: $%&.'
passwordsDoNotMatch: Passwords do not match passwordsDoNotMatch: Passwords do not match
passwordEmpty: Password empty
es-ES: es-ES:
changePassword: Cambiar contraseña changePassword: Cambiar contraseña
newPassword: Nueva contraseña newPassword: Nueva contraseña
@ -157,6 +162,7 @@ es-ES:
digits: '{nDigits} dígitos' digits: '{nDigits} dígitos'
symbols: '{nPunct} símbolos. Ej: $%&.' symbols: '{nPunct} símbolos. Ej: $%&.'
passwordsDoNotMatch: ¡Las contraseñas no coinciden! passwordsDoNotMatch: ¡Las contraseñas no coinciden!
passwordEmpty: Contraseña vacía
ca-ES: ca-ES:
changePassword: Canviar contrasenya changePassword: Canviar contrasenya
newPassword: Nova contrasenya newPassword: Nova contrasenya
@ -171,6 +177,7 @@ ca-ES:
digits: '{nDigits} dígits' digits: '{nDigits} dígits'
symbols: '{nPunct} símbols. Ej: $%&.' symbols: '{nPunct} símbols. Ej: $%&.'
passwordsDoNotMatch: Les contrasenyes no coincideixen! passwordsDoNotMatch: Les contrasenyes no coincideixen!
passwordEmpty: Contrasenya buida
fr-FR: fr-FR:
changePassword: Changer le mot de passe changePassword: Changer le mot de passe
newPassword: Nouveau mot de passe newPassword: Nouveau mot de passe
@ -185,6 +192,7 @@ fr-FR:
digits: '{nDigits} chiffres' digits: '{nDigits} chiffres'
symbols: '{nPunct} symboles. Ej: $%&.' symbols: '{nPunct} symboles. Ej: $%&.'
passwordsDoNotMatch: Les mots de passe ne correspondent pas! passwordsDoNotMatch: Les mots de passe ne correspondent pas!
passwordEmpty: Mots de passe vides
pt-PT: pt-PT:
changePassword: Alterar palavra-passe changePassword: Alterar palavra-passe
newPassword: Nova palavra-passe newPassword: Nova palavra-passe
@ -199,4 +207,5 @@ pt-PT:
digits: '{nDigits} dígitos' digits: '{nDigits} dígitos'
symbols: '{nPunct} símbolos. Ej: $%&.' symbols: '{nPunct} símbolos. Ej: $%&.'
passwordsDoNotMatch: As palavras-passe não coincidem! passwordsDoNotMatch: As palavras-passe não coincidem!
passwordEmpty: Palavra-passe vazia
</i18n> </i18n>