Removed user model
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
eded1ebf20
commit
d773837740
|
@ -43,18 +43,18 @@ module.exports = Self => {
|
|||
let where = usesEmail
|
||||
? {email: user}
|
||||
: {name: user};
|
||||
let account = await Self.findOne({
|
||||
fields: ['active', 'password'],
|
||||
let vnUser = await Self.findOne({
|
||||
fields: ['active', 'oldPassword'],
|
||||
where
|
||||
});
|
||||
|
||||
let validCredentials = instance && (
|
||||
await instance.hasPassword(password) ||
|
||||
account.password == md5(password || '')
|
||||
vnUser.oldPassword == md5(password || '')
|
||||
);
|
||||
|
||||
if (validCredentials) {
|
||||
if (!account.active)
|
||||
if (!vnUser.active)
|
||||
throw new UserError('User disabled');
|
||||
|
||||
try {
|
||||
|
|
|
@ -142,9 +142,6 @@
|
|||
},
|
||||
"PrintConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"user": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"name": "user",
|
||||
"base": "User",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "salix.User"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"forceId": false
|
||||
},
|
||||
"username":{
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,6 +29,13 @@
|
|||
"columnName": "bcryptPassword"
|
||||
}
|
||||
},
|
||||
"oldPassword": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"mysql": {
|
||||
"columnName": "password"
|
||||
}
|
||||
},
|
||||
"roleFk": {
|
||||
"type": "number",
|
||||
"mysql": {
|
||||
|
|
|
@ -177,7 +177,7 @@ module.exports = Self => {
|
|||
|
||||
async syncUser(userName, info, password) {
|
||||
if (info.user && password)
|
||||
await app.models.user.setPassword(info.user.id, password);
|
||||
await app.models.VnUser.setPassword(info.user.id, password);
|
||||
},
|
||||
|
||||
async getUsers(usersToSync) {
|
||||
|
|
Loading…
Reference in New Issue