From 985e258529a0debad2e27172049fc0e91bc9ee13 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 21 Jul 2023 12:33:14 +0200 Subject: [PATCH] refs #5769 fix(web-access): email rule --- back/methods/vn-user/privileges.js | 2 +- back/models/vn-user.js | 2 +- modules/client/front/web-access/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 a7ce12073..985f017a5 100644 --- a/back/models/vn-user.js +++ b/back/models/vn-user.js @@ -20,7 +20,7 @@ module.exports = function(Self) { Self.validatesFormatOf('email', { message: 'Invalid email', allowNull: true, - allowBlank: true, + allowBlank: false, with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/ }); diff --git a/modules/client/front/web-access/index.html b/modules/client/front/web-access/index.html index 74407ba5c..bf3d34c79 100644 --- a/modules/client/front/web-access/index.html +++ b/modules/client/front/web-access/index.html @@ -39,7 +39,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">