feat: add dingtalk union_id (#1110)

This commit is contained in:
tom2nonames
2022-09-08 14:44:06 +08:00
committed by GitHub
parent e158b58ffa
commit 6035b98653
3 changed files with 12 additions and 0 deletions

View File

@ -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)