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
|
// Database
|
||||||
|
|
||||||
if (user) {
|
if (user && user.active) {
|
||||||
let bcryptPassword = password
|
let bcryptPassword = password
|
||||||
? $.User.hashPassword(password)
|
? $.User.hashPassword(password)
|
||||||
: user.bcryptPassword;
|
: user.bcryptPassword;
|
||||||
|
@ -175,18 +175,17 @@ module.exports = Self => {
|
||||||
);
|
);
|
||||||
|
|
||||||
let appUser = {
|
let appUser = {
|
||||||
id: user.id,
|
|
||||||
username: userName,
|
username: userName,
|
||||||
email: user.email,
|
email: user.email,
|
||||||
created: user.created,
|
created: user.created,
|
||||||
updated: user.updated
|
updated: user.updated
|
||||||
};
|
};
|
||||||
|
|
||||||
if (bcryptPassword)
|
if (bcryptPassword)
|
||||||
appUser.password = bcryptPassword;
|
appUser.password = bcryptPassword;
|
||||||
|
|
||||||
await $.user.upsert(appUser);
|
await $.user.replaceById(user.id, appUser);
|
||||||
}
|
} else
|
||||||
|
await $.user.destroyAll({userName});
|
||||||
|
|
||||||
// SIP
|
// SIP
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue