User sync fixes
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
ba5a03c980
commit
ae94d7db02
|
@ -165,7 +165,7 @@ module.exports = Self => {
|
|||
|
||||
// Database
|
||||
|
||||
if (user) {
|
||||
if (user && user.active) {
|
||||
let bcryptPassword = password
|
||||
? $.User.hashPassword(password)
|
||||
: user.bcryptPassword;
|
||||
|
@ -175,18 +175,17 @@ module.exports = Self => {
|
|||
);
|
||||
|
||||
let appUser = {
|
||||
id: user.id,
|
||||
username: userName,
|
||||
email: user.email,
|
||||
created: user.created,
|
||||
updated: user.updated
|
||||
};
|
||||
|
||||
if (bcryptPassword)
|
||||
appUser.password = bcryptPassword;
|
||||
|
||||
await $.user.upsert(appUser);
|
||||
}
|
||||
await $.user.replaceById(user.id, appUser);
|
||||
} else
|
||||
await $.user.destroyAll({userName});
|
||||
|
||||
// SIP
|
||||
|
||||
|
|
Loading…
Reference in New Issue