mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
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:
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user