fix: handle WeChat username conflicts (#771)

* handle username conflicts

* Update auth.go

Co-authored-by: roobtyan <roobtyan@qq.com>
Co-authored-by: Yang Luo <hsluoyz@qq.com>
This commit is contained in:
Roobtyan
2022-05-31 21:49:56 +08:00
committed by Gucheng Wang
parent 5d8b710bf7
commit f7705931f7
3 changed files with 19 additions and 5 deletions

View File

@ -185,7 +185,7 @@ func (idp *WeChatIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error)
userInfo := UserInfo{
Id: id,
Username: id,
Username: wechatUserInfo.Nickname,
DisplayName: wechatUserInfo.Nickname,
AvatarUrl: wechatUserInfo.Headimgurl,
}