diff --git a/back/methods/vn-user/privileges.js b/back/methods/vn-user/privileges.js index 690ce74a3..08cfaaae8 100644 --- a/back/methods/vn-user/privileges.js +++ b/back/methods/vn-user/privileges.js @@ -47,7 +47,7 @@ module.exports = Self => { const user = await Self.findById(userId, {fields: ['hasGrant']}, myOptions); const userToUpdate = await Self.findById(id, { - fields: ['id', 'name', 'hasGrant', 'roleFk', 'password'], + fields: ['id', 'name', 'hasGrant', 'roleFk', 'password', 'email'], include: { relation: 'role', scope: { diff --git a/back/models/vn-user.js b/back/models/vn-user.js index fb3279353..7c32eb892 100644 --- a/back/models/vn-user.js +++ b/back/models/vn-user.js @@ -16,7 +16,7 @@ module.exports = function(Self) { Self.validatesFormatOf('email', { message: 'Invalid email', allowNull: true, - allowBlank: true, + allowBlank: false, with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/ }); @@ -139,7 +139,6 @@ module.exports = function(Self) { if (cb) cb(err); else throw err; } }; - Self.sharedClass._methods.find(method => method.name == 'changePassword') .accessScopes = ['change-password']; diff --git a/modules/client/front/web-access/index.html b/modules/client/front/web-access/index.html index 15dc5ed58..010320f3f 100644 --- a/modules/client/front/web-access/index.html +++ b/modules/client/front/web-access/index.html @@ -1,6 +1,6 @@ @@ -41,7 +41,7 @@ label="Recovery email" ng-model="$ctrl.account.email" info="This email is used for user to regain access their account." - rule="VnUser.name"> + rule="VnUser.email">