summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorFlorent MONTHEL <fmonthel@flox-arts.net>2017-03-04 20:42:25 -0500
committerFlorent MONTHEL <fmonthel@flox-arts.net>2017-03-04 20:42:25 -0500
commitad6471d3bd05b3ea50dd8699f7ac2d0adc031b06 (patch)
tree48b901a010dd6018002e3a8fc1acc309cb554ded /models/users.js
parentfd9357a49589eb52e94b44a2eb405765b640f758 (diff)
downloadwekan-ad6471d3bd05b3ea50dd8699f7ac2d0adc031b06.tar.gz
wekan-ad6471d3bd05b3ea50dd8699f7ac2d0adc031b06.tar.bz2
wekan-ad6471d3bd05b3ea50dd8699f7ac2d0adc031b06.zip
[ENH] Invite user with lower case email
Diffstat (limited to 'models/users.js')
-rw-r--r--models/users.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/users.js b/models/users.js
index 58513231..da2d02ee 100644
--- a/models/users.js
+++ b/models/users.js
@@ -349,7 +349,8 @@ if (Meteor.isServer) {
} else {
if (posAt <= 0) throw new Meteor.Error('error-user-doesNotExist');
- const email = username;
+ // Set in lowercase email before creating account
+ const email = username.toLowerCase();
username = email.substring(0, posAt);
const newUserId = Accounts.createUser({ username, email });
if (!newUserId) throw new Meteor.Error('error-user-notCreated');
@@ -377,7 +378,7 @@ if (Meteor.isServer) {
};
const lang = user.getLanguage();
Email.send({
- to: user.emails[0].address,
+ to: user.emails[0].address.toLowerCase(),
from: Accounts.emailTemplates.from,
subject: TAPi18n.__('email-invite-subject', params, lang),
text: TAPi18n.__('email-invite-text', params, lang),