fix: unchanged masked client_secret/password updated to *** (#749)

This commit is contained in:
greenhandatsjtu
2022-05-10 17:37:12 +08:00
committed by GitHub
parent 5dac87a4c3
commit 8efd964835
5 changed files with 27 additions and 5 deletions

View File

@ -133,7 +133,11 @@ func UpdateSyncer(id string, syncer *Syncer) bool {
return false
}
affected, err := adapter.Engine.ID(core.PK{owner, name}).AllCols().Update(syncer)
session := adapter.Engine.ID(core.PK{owner, name}).AllCols()
if syncer.Password == "***" {
session.Omit("password")
}
affected, err := session.Update(syncer)
if err != nil {
panic(err)
}