|
|
@ -80,12 +80,12 @@ func (err errCallback) Error() string { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type userInfoResponse struct { |
|
|
|
type userInfoResponse struct { |
|
|
|
Sub string `json:"sub"` |
|
|
|
Sub string `json:"sub"` |
|
|
|
Name string `json:"name"` |
|
|
|
Name string `json:"name"` |
|
|
|
Username string `json:"preferred_username"` |
|
|
|
PreferredUsername string `json:"preferred_username"` |
|
|
|
Email string `json:"email"` |
|
|
|
Email string `json:"email"` |
|
|
|
Picture string `json:"picture"` |
|
|
|
Picture string `json:"picture"` |
|
|
|
Groups []string `json:"groups"` |
|
|
|
Groups []string `json:"groups"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// InfoOAuth manages request for userinfo endpoint
|
|
|
|
// InfoOAuth manages request for userinfo endpoint
|
|
|
@ -97,11 +97,11 @@ func InfoOAuth(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
response := &userInfoResponse{ |
|
|
|
response := &userInfoResponse{ |
|
|
|
Sub: fmt.Sprint(ctx.Doer.ID), |
|
|
|
Sub: fmt.Sprint(ctx.Doer.ID), |
|
|
|
Name: ctx.Doer.FullName, |
|
|
|
Name: ctx.Doer.FullName, |
|
|
|
Username: ctx.Doer.Name, |
|
|
|
PreferredUsername: ctx.Doer.Name, |
|
|
|
Email: ctx.Doer.Email, |
|
|
|
Email: ctx.Doer.Email, |
|
|
|
Picture: ctx.Doer.AvatarLink(ctx), |
|
|
|
Picture: ctx.Doer.AvatarLink(ctx), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
groups, err := oauth2_provider.GetOAuthGroupsForUser(ctx, ctx.Doer) |
|
|
|
groups, err := oauth2_provider.GetOAuthGroupsForUser(ctx, ctx.Doer) |
|
|
|