mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix hashed login token test failures caused by merge mishap.
This commit is contained in:
@@ -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)
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user