Skip to content

Commit f271ac9

Browse files
committed
ExportAdapter destroy nothing will cause change password failed
Changing password without any session will failed, due to clear no session with response ObjectNotFound.
1 parent f8ae863 commit f271ac9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ExportAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ ExportAdapter.prototype.destroy = function(className, query, options = {}) {
306306

307307
return coll.remove(mongoWhere);
308308
}).then((resp) => {
309-
if (resp.result.n === 0) {
309+
//Check _Session to avoid changing password failed without any session.
310+
if (resp.result.n === 0 && className !== "_Session") {
310311
return Promise.reject(
311312
new Parse.Error(Parse.Error.OBJECT_NOT_FOUND,
312313
'Object not found.'));

0 commit comments

Comments
 (0)