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:
@@ -306,7 +306,8 @@ ExportAdapter.prototype.destroy = function(className, query, options = {}) {
|
|||||||
|
|
||||||
return coll.remove(mongoWhere);
|
return coll.remove(mongoWhere);
|
||||||
}).then((resp) => {
|
}).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(
|
return Promise.reject(
|
||||||
new Parse.Error(Parse.Error.OBJECT_NOT_FOUND,
|
new Parse.Error(Parse.Error.OBJECT_NOT_FOUND,
|
||||||
'Object not found.'));
|
'Object not found.'));
|
||||||
|
|||||||
Reference in New Issue
Block a user