feat: fix display name null error during 3rd-party binding (#1747)

This commit is contained in:
OutOfEastGate
2023-04-17 15:39:33 +08:00
committed by GitHub
parent 714f69be7b
commit ee5c3f3f39

View File

@ -131,6 +131,12 @@ func SetUserOAuthProperties(organization *Organization, user *User, providerType
if user.DisplayName == "" {
user.DisplayName = userInfo.DisplayName
}
} else if user.DisplayName == "" {
if userInfo.Username != "" {
user.DisplayName = userInfo.Username
} else {
user.DisplayName = userInfo.Id
}
}
if userInfo.Email != "" {
propertyName := fmt.Sprintf("oauth_%s_email", providerType)