refs #5769 fix: web_access email validation
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-06-21 11:36:10 +02:00
parent a4d3e8efd0
commit 6275b8528e
3 changed files with 4 additions and 5 deletions

View File

@ -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: {

View File

@ -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'];

View File

@ -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">
</vn-textfield>
</vn-horizontal>
</vn-card>