Remove all verificationTokens for a specific email once verified

This will break the other verification email links but it will keep the
user document cleaner. The email will be verified anyways so who cares
that the other verification links isn’t working any more.

Closes #4626
This commit is contained in:
Simon Fridlund
2015-07-01 09:13:34 +02:00
committed by Sashko Stubailo
parent d634651232
commit f91da45458

View File

@@ -739,7 +739,7 @@ Meteor.methods({verifyEmail: function (token) {
{_id: user._id,
'emails.address': tokenRecord.address},
{$set: {'emails.$.verified': true},
$pull: {'services.email.verificationTokens': {token: token}}});
$pull: {'services.email.verificationTokens': {address: tokenRecord.address}}});
return {userId: user._id};
}