diff --git a/src/RestWrite.js b/src/RestWrite.js index bc2b91bac8..b1700fe8dd 100644 --- a/src/RestWrite.js +++ b/src/RestWrite.js @@ -65,12 +65,12 @@ RestWrite.prototype.execute = function() { return this.handleInstallation(); }).then(() => { return this.handleSession(); + }).then(() => { + return this.validateAuthData(); }).then(() => { return this.runBeforeTrigger(); }).then(() => { return this.setRequiredFieldsIfNeeded(); - }).then(() => { - return this.validateAuthData(); }).then(() => { return this.transformUser(); }).then(() => { @@ -111,6 +111,10 @@ RestWrite.prototype.validateSchema = function() { // Runs any beforeSave triggers against this operation. // Any change leads to our data being mutated. RestWrite.prototype.runBeforeTrigger = function() { + if (this.response) { + return; + } + // Cloud code gets a bit of extra data for its objects var extraData = {className: this.className}; if (this.query && this.query.objectId) {