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

Fix email verification MongoDB index #4482

Closed
wants to merge 1 commit into from
Closed

Conversation

alanning
Copy link
Contributor

The original index, "emails.validationTokens.token" is incorrect; it is never used in meteor. A search of "validationTokens" across all the packages in meteor/packages returns nothing.

The correct index should be, "services.email.verificationTokens.token". This is set in the Accounts.sendVerificationEmail function and queried in the verifyEmail method to locate the appropriate user record.

Without a matching index, a full table scan is run each time the verifyEmail method is called.

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.
@alanning alanning changed the title Fix email verification token index Fix email verification MongoDB index May 31, 2015
@glasser glasser closed this in 9f2c35e Jun 2, 2015
@glasser
Copy link
Contributor

glasser commented Jun 2, 2015

Thanks, merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants