Run Schema validations after beforeSave #2672 (#2677)

* Adds test to repro #2672

* Run schema validation after beforeSave is run

* Makes authData part of base _User object

* exclude flaky pg test
This commit is contained in:
Florent Vilmart
2016-09-09 14:41:03 -04:00
committed by GitHub
parent 58a2ee32fa
commit 364604e181
5 changed files with 48 additions and 5 deletions

View File

@@ -31,6 +31,7 @@ const defaultColumns = Object.freeze({
"password": {type:'String'},
"email": {type:'String'},
"emailVerified": {type:'Boolean'},
"authData": {type:'Object'}
},
// The additional default columns for the _Installation collection (in addition to DefaultCols)
_Installation: {

View File

@@ -62,8 +62,6 @@ RestWrite.prototype.execute = function() {
return this.getUserAndRoleACL();
}).then(() => {
return this.validateClientClassCreation();
}).then(() => {
return this.validateSchema();
}).then(() => {
return this.handleInstallation();
}).then(() => {
@@ -72,6 +70,8 @@ RestWrite.prototype.execute = function() {
return this.validateAuthData();
}).then(() => {
return this.runBeforeTrigger();
}).then(() => {
return this.validateSchema();
}).then(() => {
return this.setRequiredFieldsIfNeeded();
}).then(() => {
@@ -176,7 +176,6 @@ RestWrite.prototype.runBeforeTrigger = function() {
if (this.query && this.query.objectId) {
delete this.data.objectId
}
return this.validateSchema();
}
});
};