mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Meteor.changePassword -> Accounts.changePassword
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
// @param oldPassword {String|null}
|
||||
// @param newPassword {String}
|
||||
// @param callback {Function(error|undefined)}
|
||||
Meteor.changePassword = function (oldPassword, newPassword, callback) {
|
||||
Accounts.changePassword = function (oldPassword, newPassword, callback) {
|
||||
if (!Meteor.user()) {
|
||||
callback && callback(new Error("Must be logged in to change password."));
|
||||
return;
|
||||
|
||||
@@ -101,14 +101,14 @@ if (Meteor.isClient) (function () {
|
||||
},
|
||||
// change password with bad old password.
|
||||
function (test, expect) {
|
||||
Meteor.changePassword(password2, password2, expect(function (error) {
|
||||
Accounts.changePassword(password2, password2, expect(function (error) {
|
||||
test.isTrue(error);
|
||||
test.equal(Meteor.user().username, username);
|
||||
}));
|
||||
},
|
||||
// change password with good old password.
|
||||
function (test, expect) {
|
||||
Meteor.changePassword(password, password2, expect(function (error) {
|
||||
Accounts.changePassword(password, password2, expect(function (error) {
|
||||
test.equal(error, undefined);
|
||||
test.equal(Meteor.user().username, username);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user