refs #5769 fix: web_access email validation
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a4d3e8efd0
commit
6275b8528e
|
@ -47,7 +47,7 @@ module.exports = Self => {
|
||||||
const user = await Self.findById(userId, {fields: ['hasGrant']}, myOptions);
|
const user = await Self.findById(userId, {fields: ['hasGrant']}, myOptions);
|
||||||
|
|
||||||
const userToUpdate = await Self.findById(id, {
|
const userToUpdate = await Self.findById(id, {
|
||||||
fields: ['id', 'name', 'hasGrant', 'roleFk', 'password'],
|
fields: ['id', 'name', 'hasGrant', 'roleFk', 'password', 'email'],
|
||||||
include: {
|
include: {
|
||||||
relation: 'role',
|
relation: 'role',
|
||||||
scope: {
|
scope: {
|
||||||
|
|
|
@ -16,7 +16,7 @@ module.exports = function(Self) {
|
||||||
Self.validatesFormatOf('email', {
|
Self.validatesFormatOf('email', {
|
||||||
message: 'Invalid email',
|
message: 'Invalid email',
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
allowBlank: true,
|
allowBlank: false,
|
||||||
with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/
|
with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -139,7 +139,6 @@ module.exports = function(Self) {
|
||||||
if (cb) cb(err); else throw err;
|
if (cb) cb(err); else throw err;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Self.sharedClass._methods.find(method => method.name == 'changePassword')
|
Self.sharedClass._methods.find(method => method.name == 'changePassword')
|
||||||
.accessScopes = ['change-password'];
|
.accessScopes = ['change-password'];
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<vn-watcher
|
<vn-watcher
|
||||||
vn-id="watcher"
|
vn-id="watcher"
|
||||||
url="VnUsers"
|
url="VnUsers"
|
||||||
id-field="id"
|
id-field="id"
|
||||||
data="$ctrl.account"
|
data="$ctrl.account"
|
||||||
form="form">
|
form="form">
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
label="Recovery email"
|
label="Recovery email"
|
||||||
ng-model="$ctrl.account.email"
|
ng-model="$ctrl.account.email"
|
||||||
info="This email is used for user to regain access their account."
|
info="This email is used for user to regain access their account."
|
||||||
rule="VnUser.name">
|
rule="VnUser.email">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
|
|
Loading…
Reference in New Issue