Use better name for userinfo structure (#32544)

pull/32528/head^2
Lunny Xiao 1 week ago committed by GitHub
parent c3dedcffa7
commit f122aaf9ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      routers/web/auth/oauth2_provider.go

@ -82,7 +82,7 @@ func (err errCallback) Error() string {
type userInfoResponse struct {
Sub string `json:"sub"`
Name string `json:"name"`
Username string `json:"preferred_username"`
PreferredUsername string `json:"preferred_username"`
Email string `json:"email"`
Picture string `json:"picture"`
Groups []string `json:"groups"`
@ -99,7 +99,7 @@ func InfoOAuth(ctx *context.Context) {
response := &userInfoResponse{
Sub: fmt.Sprint(ctx.Doer.ID),
Name: ctx.Doer.FullName,
Username: ctx.Doer.Name,
PreferredUsername: ctx.Doer.Name,
Email: ctx.Doer.Email,
Picture: ctx.Doer.AvatarLink(ctx),
}

Loading…
Cancel
Save