Fix empty UserInfo ID in wecom_internal.go

This commit is contained in:
Gucheng Wang
2022-01-29 10:27:45 +08:00
parent a8502d1173
commit 034d822dd5
2 changed files with 4 additions and 0 deletions

View File

@ -163,5 +163,9 @@ func (idp *WeComInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo,
AvatarUrl: infoResp.Avatar, AvatarUrl: infoResp.Avatar,
} }
if userInfo.Id == "" {
userInfo.Id = userInfo.Username
}
return &userInfo, nil return &userInfo, nil
} }