diff --git a/models/organisation_invite.model.js b/models/organisation_invite.model.js index d97637a4..cce36883 100644 --- a/models/organisation_invite.model.js +++ b/models/organisation_invite.model.js @@ -13,6 +13,9 @@ const orgInvites = sequelize.define( email: { type: DataTypes.STRING, allowNull: false, + validate: { + isEmail: { msg: 'Invalid email' }, + }, }, token: { type: DataTypes.STRING, diff --git a/models/user.model.js b/models/user.model.js index b6eb91d9..8176654d 100644 --- a/models/user.model.js +++ b/models/user.model.js @@ -22,6 +22,9 @@ const User = sequelize.define( type: DataTypes.STRING, unique: true, allowNull: false, + validate: { + isEmail: { msg: 'Invalid email' }, + }, }, password_hash: { type: DataTypes.STRING,