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 userToUpdate = await Self.findById(id, {
|
||||
fields: ['id', 'name', 'hasGrant', 'roleFk', 'password'],
|
||||
fields: ['id', 'name', 'hasGrant', 'roleFk', 'password', 'email'],
|
||||
include: {
|
||||
relation: 'role',
|
||||
scope: {
|
||||
|
|
|
@ -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'];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<vn-watcher
|
||||
vn-id="watcher"
|
||||
url="VnUsers"
|
||||
url="VnUsers"
|
||||
id-field="id"
|
||||
data="$ctrl.account"
|
||||
form="form">
|
||||
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue