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
ae94d7db02
commit
1354d4647d
|
@ -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});
|
||||
|
||||
|
|
Loading…
Reference in New Issue