Validate authData before triggering beforeSave
This commit is contained in:
@@ -67,12 +67,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(() => {
|
||||
@@ -134,6 +134,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;
|
||||
}
|
||||
|
||||
// Avoid doing any setup for triggers if there is no 'beforeSave' trigger for this class.
|
||||
if (!triggers.triggerExists(this.className, triggers.Types.beforeSave, this.config.applicationId)) {
|
||||
return Promise.resolve();
|
||||
|
||||
Reference in New Issue
Block a user