From 40a3267615d34b011acbf19d6706a85d98e2e8fb Mon Sep 17 00:00:00 2001 From: Ole Langbehn Date: Sat, 16 Mar 2019 14:25:04 +0100 Subject: make emails for invitations all lowercase for compatibility with AccountsTemplates Email addresses for invitations are stored case sensitive in mongo, together with the invitation codes. When someone tries to sign up due to an invitation, in the sign up form, due to AccountsTemplates defaults, the email address is lowercased on blur of the textbox. When they then try to sign in, they get an error about the invitation code not existing. This makes it impossible to successfully invite people using non-lowercased email addresses. This patch lowercases the emails on the client side when inviting them. Other possibilities would be to lowercase them on the server side before storing them to mongodb, making a case insensitive search on mongodb, or making the email input field in the sign up form not lowercase the email string. This patch was chosen in favor of the other possibilities because of its simplicity. --- client/components/settings/settingBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 2f58d551..8279a092 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -90,7 +90,7 @@ BlazeComponent.extendComponent({ }, inviteThroughEmail() { - const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(','); + const emails = $('#email-to-invite').val().toLowerCase().trim().split('\n').join(',').split(','); const boardsToInvite = []; $('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () { boardsToInvite.push($(this).data('id')); -- cgit v1.2.3-1-g7c22