1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Use user.FullName in Oauth2 id_token response (#32542)

This makes `/login/oauth/authorize` behave the same way as the
`/login/oauth/userinfo` endpoint.
This commit is contained in:
Baltazár Radics
2024-11-18 12:24:17 +01:00
committed by GitHub
parent 896314c7a2
commit 5eb0ee49a1
3 changed files with 3 additions and 22 deletions

View File

@@ -148,7 +148,7 @@ func NewAccessTokenResponse(ctx context.Context, grant *auth.OAuth2Grant, server
Nonce: grant.Nonce,
}
if grant.ScopeContains("profile") {
idToken.Name = user.GetDisplayName()
idToken.Name = user.DisplayName()
idToken.PreferredUsername = user.Name
idToken.Profile = user.HTMLURL()
idToken.Picture = user.AvatarLink(ctx)