User sync fixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-10-31 02:26:17 +01:00
parent ae94d7db02
commit 1354d4647d
1 changed files with 5 additions and 1 deletions

View File

@ -175,6 +175,7 @@ module.exports = Self => {
);
let appUser = {
id: user.id,
username: userName,
email: user.email,
created: user.created,
@ -183,7 +184,10 @@ module.exports = Self => {
if (bcryptPassword)
appUser.password = bcryptPassword;
await $.user.replaceById(user.id, appUser);
if (await $.user.exists(user.id))
await $.user.replaceById(user.id, appUser);
else
await $.user.upsert(appUser);
} else
await $.user.destroyAll({userName});