mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
feat: fix display name null error during 3rd-party binding (#1747)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user