mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix email verification token index
The original index, "emails.validationTokens.token" is never used in any meteor packages. A search of "validationTokens" across all the packages in `meteor/packages` returns nothing. The correct index should be, "services.email.verificationTokens.token". This is used in the `verifyEmail` method to locate the correct user record. Without a matching index, this causes a full table scan each time `verifyEmail` is called. Fixes #4482.
This commit is contained in:
committed by
David Glasser
parent
4eb017a4ab
commit
9f2c35e253
@@ -100,6 +100,10 @@
|
||||
`AccountsServer` constructors, so that users can create multiple
|
||||
independent instances of the `Accounts` namespace. #4233
|
||||
|
||||
* Create an index for `Meteor.users` on
|
||||
`services.email.verificationTokens.token` (instead of
|
||||
`emails.validationTokens.token`, which never was used for anything). #4482
|
||||
|
||||
### Minimongo
|
||||
|
||||
* The `$push` query modifier now supports a `$position` argument. #4312
|
||||
|
||||
@@ -779,7 +779,7 @@ Accounts.createUser = function (options, callback) {
|
||||
///
|
||||
/// PASSWORD-SPECIFIC INDEXES ON USERS
|
||||
///
|
||||
Meteor.users._ensureIndex('emails.validationTokens.token',
|
||||
Meteor.users._ensureIndex('services.email.verificationTokens.token',
|
||||
{unique: 1, sparse: 1});
|
||||
Meteor.users._ensureIndex('services.password.reset.token',
|
||||
{unique: 1, sparse: 1});
|
||||
|
||||
Reference in New Issue
Block a user