Rename Meteor.setPassword to Accounts.setPassword, matching docs.

We meant to do this before releasing 0.5.0 (thus the docs) but mistakenly did
not.

Fixes #454.
This commit is contained in:
David Glasser
2012-11-05 10:51:41 -08:00
parent f58cbc620a
commit bad0726a99
2 changed files with 3 additions and 3 deletions

View File

@@ -354,7 +354,7 @@
});
Meteor.setPassword = function (userId, newPassword) {
Accounts.setPassword = function (userId, newPassword) {
var user = Meteor.users.findOne(userId);
if (!user)
throw new Meteor.Error(403, "User not found");

View File

@@ -310,13 +310,13 @@ if (Meteor.isServer) (function () {
test.equal(user.services.password, undefined);
// set a new password.
Meteor.setPassword(userId, 'new password');
Accounts.setPassword(userId, 'new password');
user = Meteor.users.findOne(userId);
var oldVerifier = user.services.password.srp;
test.isTrue(user.services.password.srp);
// reset with the same password, see we get a different verifier
Meteor.setPassword(userId, 'new password');
Accounts.setPassword(userId, 'new password');
user = Meteor.users.findOne(userId);
var newVerifier = user.services.password.srp;
test.notEqual(oldVerifier.salt, newVerifier.salt);