@@ -187,7 +187,7 @@ func newAccessTokenResponse(grant *models.OAuth2Grant, signingKey oauth2.JWTSign
187
187
ErrorDescription : "cannot find application" ,
188
188
}
189
189
}
190
- err = app . LoadUser ( )
190
+ user , err := models . GetUserByID ( grant . UserID )
191
191
if err != nil {
192
192
if models .IsErrUserNotExist (err ) {
193
193
return nil , & AccessTokenError {
@@ -212,17 +212,17 @@ func newAccessTokenResponse(grant *models.OAuth2Grant, signingKey oauth2.JWTSign
212
212
Nonce : grant .Nonce ,
213
213
}
214
214
if grant .ScopeContains ("profile" ) {
215
- idToken .Name = app . User .FullName
216
- idToken .PreferredUsername = app . User .Name
217
- idToken .Profile = app . User .HTMLURL ()
218
- idToken .Picture = app . User .AvatarLink ()
219
- idToken .Website = app . User .Website
220
- idToken .Locale = app . User .Language
221
- idToken .UpdatedAt = app . User .UpdatedUnix
215
+ idToken .Name = user .FullName
216
+ idToken .PreferredUsername = user .Name
217
+ idToken .Profile = user .HTMLURL ()
218
+ idToken .Picture = user .AvatarLink ()
219
+ idToken .Website = user .Website
220
+ idToken .Locale = user .Language
221
+ idToken .UpdatedAt = user .UpdatedUnix
222
222
}
223
223
if grant .ScopeContains ("email" ) {
224
- idToken .Email = app . User .Email
225
- idToken .EmailVerified = app . User .IsActive
224
+ idToken .Email = user .Email
225
+ idToken .EmailVerified = user .IsActive
226
226
}
227
227
228
228
signedIDToken , err = idToken .SignToken (signingKey )
0 commit comments