Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lower case emails fix #11419

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/accounts-base/accounts_common.js
Expand Up @@ -169,6 +169,7 @@ export class AccountsCommon {
* @param {Number} options.passwordEnrollTokenExpiration The number of milliseconds from when a link to set initial password is sent until token expires and user can't set password with the link anymore. If `passwordEnrollTokenExpirationInDays` is set, it takes precedent.
* @param {Boolean} options.ambiguousErrorMessages Return ambiguous error messages from login failures to prevent user enumeration. Defaults to false.
* @param {MongoFieldSpecifier} options.defaultFieldSelector To exclude by default large custom fields from `Meteor.user()` and `Meteor.findUserBy...()` functions when called without a field selector, and all `onLogin`, `onLoginFailure` and `onLogout` callbacks. Example: `Accounts.config({ defaultFieldSelector: { myBigArray: 0 }})`. Beware when using this. If, for instance, you do not include `email` when excluding the fields, you can have problems with functions like `forgotPassword` that will break because they won't have the required data available. It's recommend that you always keep the fields `_id`, `username`, and `email`.
* @param {Boolean} options.useLowerCaseEmails When this key is set to false and the fieldName argument, in "checkForCaseInsensitiveDuplicates" method, is "emails.address" then the "checkForCaseInsensitiveDuplicates" will implement "selectorForFastCaseInsensitiveLookup" method for email search else it will implement a simple regex search.
*/
config(options) {
// We don't want users to accidentally only call Accounts.config on the
Expand Down Expand Up @@ -204,7 +205,7 @@ export class AccountsCommon {
const VALID_KEYS = ["sendVerificationEmail", "forbidClientAccountCreation", "passwordEnrollTokenExpiration",
"passwordEnrollTokenExpirationInDays", "restrictCreationByEmailDomain", "loginExpirationInDays",
"loginExpiration", "passwordResetTokenExpirationInDays", "passwordResetTokenExpiration",
"ambiguousErrorMessages", "bcryptRounds", "defaultFieldSelector"];
"ambiguousErrorMessages", "bcryptRounds", "defaultFieldSelector", "useLowerCaseEmails"];
StorytellerCZ marked this conversation as resolved.
Show resolved Hide resolved

Object.keys(options).forEach(key => {
if (!VALID_KEYS.includes(key)) {
Expand Down