ExportAdapter destroy nothing will cause change password failed

Changing password without any session will failed,
due to clear no session with response ObjectNotFound.
This commit is contained in:
jim1_lin
2016-02-18 15:36:21 +08:00
parent f8ae863a2a
commit f271ac9ac1

View File

@@ -306,7 +306,8 @@ ExportAdapter.prototype.destroy = function(className, query, options = {}) {
return coll.remove(mongoWhere);
}).then((resp) => {
if (resp.result.n === 0) {
//Check _Session to avoid changing password failed without any session.
if (resp.result.n === 0 && className !== "_Session") {
return Promise.reject(
new Parse.Error(Parse.Error.OBJECT_NOT_FOUND,
'Object not found.'));