mirror of
https://github.com/songquanpeng/message-pusher.git
synced 2025-10-23 15:53:12 +08:00
fix: check if user's GitHub display name is empty
This commit is contained in:
@@ -116,7 +116,11 @@ func GitHubOAuth(c *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
if common.RegisterEnabled {
|
if common.RegisterEnabled {
|
||||||
user.Username = "github_" + strconv.Itoa(model.GetMaxUserId()+1)
|
user.Username = "github_" + strconv.Itoa(model.GetMaxUserId()+1)
|
||||||
|
if githubUser.Name != "" {
|
||||||
user.DisplayName = githubUser.Name
|
user.DisplayName = githubUser.Name
|
||||||
|
} else {
|
||||||
|
user.DisplayName = "GitHub User"
|
||||||
|
}
|
||||||
user.Email = githubUser.Email
|
user.Email = githubUser.Email
|
||||||
user.Role = common.RoleCommonUser
|
user.Role = common.RoleCommonUser
|
||||||
user.Status = common.UserStatusEnabled
|
user.Status = common.UserStatusEnabled
|
||||||
|
Reference in New Issue
Block a user