Fix hashed login token test failures caused by merge mishap.

This commit is contained in:
Emily Stark
2014-01-02 18:23:34 -08:00
parent b296dcbdf2
commit 83fde36e00

View File

@@ -74,12 +74,23 @@ Accounts.createToken = function (options) {
throw new Meteor.Error(400, "Unrecognized options for login request");
};
// Deletes the given loginToken from the database. This will cause all
// connections associated with the token to be closed.
// Deletes the given loginToken from the database.
//
// For new-style hashed token, this will cause all connections
// associated with the token to be closed.
//
// Any connections associated with old-style unhashed tokens will be
// in the process of becoming associated with hashed tokens and then
// they'll get closed.
Accounts.destroyToken = function (userId, loginToken) {
Meteor.users.update(userId, {
$pull: {
"services.resume.loginTokens": { "token": loginToken }
"services.resume.loginTokens": {
$or: [
{ hashedToken: loginToken },
{ token: loginToken }
]
}
}
});
};
@@ -108,7 +119,7 @@ Meteor.methods({
Meteor._noYieldsAllowed(function () {
Accounts._setLoginToken(
result.id,
this.connection,
self.connection,
Accounts._hashLoginToken(result.token)
);
});