From 8487c9314b9da962f42ed86a472086f1ce7c37db Mon Sep 17 00:00:00 2001 From: Ashwani Yadav Date: Sat, 28 Dec 2019 15:36:34 +0530 Subject: [PATCH 1/2] Disabled resend password button if email is not valid --- app/ui-account/client/accountProfile.html | 2 +- app/ui-account/client/accountProfile.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/ui-account/client/accountProfile.html b/app/ui-account/client/accountProfile.html index e0b7483d06744..170e4d7849306 100644 --- a/app/ui-account/client/accountProfile.html +++ b/app/ui-account/client/accountProfile.html @@ -152,7 +152,7 @@ {{/unless}} {{#unless emailVerified}}
- +
{{/unless}} diff --git a/app/ui-account/client/accountProfile.js b/app/ui-account/client/accountProfile.js index 4fdd494bb250a..a27f522184c9e 100644 --- a/app/ui-account/client/accountProfile.js +++ b/app/ui-account/client/accountProfile.js @@ -142,6 +142,13 @@ Template.accountProfile.helpers({ return ret; } }, + canResendEmailConf(ret) { + const instance = Template.instance(); + const email = instance.email.get(); + if (!email || !validateEmail(email)) { + return ret; + } + }, allowDeleteOwnAccount() { return settings.get('Accounts_AllowDeleteOwnAccount'); }, From 4d4c45e24310d49ec41fb23af6d05bfb1ada6dc0 Mon Sep 17 00:00:00 2001 From: Ashwani Yadav Date: Tue, 28 Jan 2020 00:32:23 +0530 Subject: [PATCH 2/2] added check for email to match database email --- app/ui-account/client/accountProfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/ui-account/client/accountProfile.js b/app/ui-account/client/accountProfile.js index a20f069da1884..6880db8bd45e3 100644 --- a/app/ui-account/client/accountProfile.js +++ b/app/ui-account/client/accountProfile.js @@ -143,9 +143,9 @@ Template.accountProfile.helpers({ } }, canResendEmailConf(ret) { - const instance = Template.instance(); - const email = instance.email.get(); - if (!email || !validateEmail(email)) { + const email = Template.instance().email.get(); + const user = Meteor.user(); + if (getUserEmailAddress(user) && getUserEmailAddress(user) !== email) { return ret; } },