Fix create wrong _Session for Facebook login

This commit is contained in:
Long Nguyen
2016-03-06 01:32:50 +07:00
parent c6ae64bdbe
commit 4f643d970a
2 changed files with 14 additions and 1 deletions

View File

@@ -178,7 +178,11 @@ RestWrite.prototype.setRequiredFieldsIfNeeded = function() {
this.data.updatedAt = this.updatedAt;
if (!this.query) {
this.data.createdAt = this.updatedAt;
this.data.objectId = cryptoUtils.newObjectId();
// Only assign new objectId if we are creating new object
if (!this.data.objectId) {
this.data.objectId = cryptoUtils.newObjectId();
}
}
}
return Promise.resolve();