fix _authenticate call to always pass the json object

This commit is contained in:
blagoev 2017-09-12 20:26:08 +03:00
parent a51ea72151
commit 3fbd1291e1
1 changed files with 7 additions and 16 deletions

View File

@ -152,7 +152,7 @@ function _authenticate(userConstructor, server, json, callback) {
callback(null, user);
})
.catch(err => {
callback(err)
callback(err);
});
} else {
return promise;
@ -188,11 +188,9 @@ const staticMethods = {
user_info: { password: password, register: true },
data: username
};
if (callback) {
_authenticate(this, server, json, callback);
} else {
return _authenticate(this, server)
}
},
login(server, username, password, callback) {
@ -202,11 +200,8 @@ const staticMethods = {
user_info: { password: password },
data: username
};
if (callback) {
_authenticate(this, server, json, callback);
} else {
return _authenticate(this, server)
}
},
registerWithProvider(server, options, callback) {
@ -233,11 +228,7 @@ const staticMethods = {
json.user_info = options.userInfo;
}
if (callback) {
_authenticate(this, server, json, callback);
} else {
return _authenticate(this, server)
}
},
_refreshAccessToken: refreshAccessToken