mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
fix: with error pq: column "DingTalk" of relation "user" does not exist (#1116)
* feat: add dingtalk union_id * fix: with pg, column Dingtalk of relation user table does not exist. * Update user_util.go Co-authored-by: Yang Luo <hsluoyz@qq.com>
This commit is contained in:
parent
e8d2906e3c
commit
8456b7f7c4
@ -80,7 +80,7 @@ func SetUserField(user *User, field string, value string) bool {
|
||||
value = user.Password
|
||||
}
|
||||
|
||||
affected, err := adapter.Engine.Table(user).ID(core.PK{user.Owner, user.Name}).Update(map[string]interface{}{field: value})
|
||||
affected, err := adapter.Engine.Table(user).ID(core.PK{user.Owner, user.Name}).Update(map[string]interface{}{strings.ToLower(field): value})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -141,9 +141,6 @@ func SetUserOAuthProperties(organization *Organization, user *User, providerType
|
||||
if userInfo.UnionId != "" {
|
||||
propertyName := fmt.Sprintf("oauth_%s_unionId", providerType)
|
||||
setUserProperty(user, propertyName, userInfo.UnionId)
|
||||
if providerType == "DingTalk" && user.DingTalk == "" {
|
||||
user.DingTalk = userInfo.UnionId
|
||||
}
|
||||
}
|
||||
|
||||
if userInfo.AvatarUrl != "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user