diff --git a/.file.out.txt.kate-swp b/.file.out.txt.kate-swp new file mode 100644 index 00000000..aa12db24 Binary files /dev/null and b/.file.out.txt.kate-swp differ diff --git a/src/common/pattern.ts b/src/common/pattern.ts index 1fded4a7..8647dda3 100755 --- a/src/common/pattern.ts +++ b/src/common/pattern.ts @@ -16,5 +16,5 @@ export class Patterns { * * 8 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol */ - public static Password = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,30})/i + public static Password = /^((?=.*[A-Z])(?=.*\d)(?=.*[@#*=])(?!.* ).{8,30})/i } diff --git a/src/components/CSignIn/CSignIn.ts b/src/components/CSignIn/CSignIn.ts index da32d0f0..08a710ef 100755 --- a/src/components/CSignIn/CSignIn.ts +++ b/src/components/CSignIn/CSignIn.ts @@ -62,33 +62,6 @@ export default defineComponent({ return '/requestresetpwd' } - function errorMsg(cosa: string, item: any) { - /* - try { - if (!item.$error) { - return '' - } - if (item.$params.email && !item.email) { - return t('reg.err.email') - } - - if (!item.required) { - return t('reg.err.required') - } - if (!item.minLength) { - return t('reg.err.atleast') + ' ${item.$params.minLength.min} ' + t('reg.err.char') - } - if (!item.maxLength) { - return t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + t('reg.err.char') - } - return '' - } catch (err) { - // console.log("ERR : " + error); - } - */ - - } - function isError() { if (refUsername.value) { // @ts-ignore @@ -172,7 +145,6 @@ export default defineComponent({ refUsername, onReset, onSubmit, - errorMsg, signin, getlinkforgetpwd, myForm, diff --git a/src/components/CSignUp/CSignUp.ts b/src/components/CSignUp/CSignUp.ts index 65f8bdf3..3914ee52 100755 --- a/src/components/CSignUp/CSignUp.ts +++ b/src/components/CSignUp/CSignUp.ts @@ -87,74 +87,6 @@ export default defineComponent({ return process.env } - function errorMsg(cosa: string, item: any) { - try { - if (!item.$error) { - return '' - } - console.log('errorMsg', cosa, item) - - if (cosa === 'repeatpassword') { - if (!item.sameAsPassword) { - return t('reg.err.sameaspassword') - } - } - - if (item.email) { - if (item.email.$invalid) - return t('reg.err.email') - } - - if (item.minLength !== undefined) { - if (item.minLength.$invalid) { - return t('reg.err.atleast') + ` ${item.minLength.$params.min} ` + t('reg.err.char') - } - } - if (item.complexity !== undefined) { - if (item.complexity.$invalid) { - return t('reg.err.complexity') - } - } - // if (!item.maxLength) { return t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + t('reg.err.char') } - - if (item.required !== undefined) { - if (item.required.$invalid) { - console.log('required') - return t('reg.err.required') - } - } - - console.log(' cosa', cosa) - - // console.log(' ....avanti') - if (cosa === 'email') { - // console.log("EMAIL " + item.isUnique); - // console.log(item); - if (!item.email.$invalid) { - return t('reg.err.duplicate_email') - } - } else if (cosa === 'username') { - // console.log(item); - console.log('username') - console.log(item.$error) - if (!item.registereduser.$invalid) { - return t('reg.err.duplicate_username') - } - } else if (cosa === 'aportador_solidario') { - // console.log(item); - if (!item.aportadorexist) { - // console.log('!item.aportadorexist !') - return t('reg.err.aportador_not_exist') - } - } else if ((cosa === 'name') || (cosa === 'surname')) { - // console.log(item); - } - - return '' - } catch (error) { - // console.log("ERR : " + error); - } - } function changeemail() { signup.email = tools.removespaces(signup.email!) @@ -223,7 +155,6 @@ export default defineComponent({ } return { - errorMsg, changeemail, changeusername, submitOk, diff --git a/src/components/CSignUp/CSignUp.vue b/src/components/CSignUp/CSignUp.vue index 4f35495e..88632adb 100755 --- a/src/components/CSignUp/CSignUp.vue +++ b/src/components/CSignUp/CSignUp.vue @@ -16,7 +16,7 @@ @blur="v$.email.$touch" @input="changeemail()" :error="v$.email.$error" - :error-message="errorMsg('email', v$.email)" + :error-message="tools.errorMsg( 'email', v$.email)" maxlength="50" debounce="3000" :label="$t('reg.email')"> @@ -36,7 +36,7 @@ @keydown.space="(event) => event.preventDefault()" maxlength="20" debounce="1000" - :error-message="errorMsg('username', v$.username)" + :error-message="tools.errorMsg( 'username', v$.username)" :label="$t('reg.username')">