mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
feat: add dingtalk union_id (#1110)
This commit is contained in:
@ -137,6 +137,15 @@ func SetUserOAuthProperties(organization *Organization, user *User, providerType
|
||||
user.Email = userInfo.Email
|
||||
}
|
||||
}
|
||||
|
||||
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 != "" {
|
||||
propertyName := fmt.Sprintf("oauth_%s_avatarUrl", providerType)
|
||||
setUserProperty(user, propertyName, userInfo.AvatarUrl)
|
||||
|
Reference in New Issue
Block a user