fix _authenticate call to always pass the json object
This commit is contained in:
parent
a51ea72151
commit
3fbd1291e1
|
@ -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)
|
||||
}
|
||||
|
||||
_authenticate(this, server, json, callback);
|
||||
|
||||
},
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
_authenticate(this, server, json, callback);
|
||||
},
|
||||
|
||||
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)
|
||||
}
|
||||
_authenticate(this, server, json, callback);
|
||||
},
|
||||
|
||||
_refreshAccessToken: refreshAccessToken
|
||||
|
|
Loading…
Reference in New Issue