From 480a0529a234f1255ae5e369af184ab2d7a1e16e Mon Sep 17 00:00:00 2001 From: Jason Carvalho Date: Fri, 12 Nov 2021 22:00:31 +0530 Subject: [PATCH] Fix logic of emailInvalid and emailValid (#13614) Fix email validation to return invalid even when 3 characters or less are present in the input field. --- website/client/src/components/auth/registerLoginReset.vue | 4 ++-- website/client/src/components/static/home.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/client/src/components/auth/registerLoginReset.vue b/website/client/src/components/auth/registerLoginReset.vue index 3ca84f7b8d..b406b124c3 100644 --- a/website/client/src/components/auth/registerLoginReset.vue +++ b/website/client/src/components/auth/registerLoginReset.vue @@ -685,11 +685,11 @@ export default { return false; }, emailValid () { - if (this.email.length <= 3) return false; + if (this.email.length < 1) return false; return isEmail(this.email); }, emailInvalid () { - if (this.email.length <= 3) return false; + if (this.email.length < 1) return false; return !this.emailValid; }, usernameValid () { diff --git a/website/client/src/components/static/home.vue b/website/client/src/components/static/home.vue index 2f9bc42c89..576b185cc8 100644 --- a/website/client/src/components/static/home.vue +++ b/website/client/src/components/static/home.vue @@ -841,11 +841,11 @@ export default { }, computed: { emailValid () { - if (this.email.length <= 3) return false; + if (this.email.length < 1) return false; return isEmail(this.email); }, emailInvalid () { - if (this.email.length <= 3) return false; + if (this.email.length < 1) return false; return !isEmail(this.email); }, usernameValid () {