syncUser() and setPassword() changes
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2023-02-02 07:32:38 +01:00
parent e34d64361b
commit 644d98ec1c
4 changed files with 44 additions and 1 deletions

View File

@ -142,6 +142,9 @@
},
"PrintConfig": {
"dataSource": "vn"
},
"user": {
"dataSource": "vn"
}
}

19
back/models/user.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "user",
"base": "User",
"options": {
"mysql": {
"table": "salix.User"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"forceId": false
},
"username":{
"type": "string"
}
}
}

View File

@ -0,0 +1,21 @@
create or replace definer = root@localhost view User as
select `account`.`user`.`id` AS `id`,
`account`.`user`.`realm` AS `realm`,
`account`.`user`.`name` AS `name`,
`account`.`user`.`nickname` AS `nickname`,
`account`.`user`.`bcryptPassword` AS `password`,
`account`.`user`.`role` AS `role`,
`account`.`user`.`active` AS `active`,
`account`.`user`.`email` AS `email`,
`account`.`user`.`emailVerified` AS `emailVerified`,
`account`.`user`.`verificationToken` AS `verificationToken`,
`account`.`user`.`lang` AS `lang`,
`account`.`user`.`lastPassChange` AS `lastPassChange`,
`account`.`user`.`created` AS `created`,
`account`.`user`.`updated` AS `updated`,
`account`.`user`.`image` AS `image`,
`account`.`user`.`recoverPass` AS `recoverPass`,
`account`.`user`.`sync` AS `sync`,
`account`.`user`.`hasGrant` AS `hasGrant`
from `account`.`user`;

View File

@ -177,7 +177,7 @@ module.exports = Self => {
async syncUser(userName, info, password) {
if (info.user && password)
await app.models.VnUser.setPassword(info.user.id, password);
await app.models.user.setPassword(info.user.id, password);
},
async getUsers(usersToSync) {