mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +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 == "" {
|
if user.DisplayName == "" {
|
||||||
user.DisplayName = userInfo.DisplayName
|
user.DisplayName = userInfo.DisplayName
|
||||||
}
|
}
|
||||||
|
} else if user.DisplayName == "" {
|
||||||
|
if userInfo.Username != "" {
|
||||||
|
user.DisplayName = userInfo.Username
|
||||||
|
} else {
|
||||||
|
user.DisplayName = userInfo.Id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if userInfo.Email != "" {
|
if userInfo.Email != "" {
|
||||||
propertyName := fmt.Sprintf("oauth_%s_email", providerType)
|
propertyName := fmt.Sprintf("oauth_%s_email", providerType)
|
||||||
|
Reference in New Issue
Block a user