mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
authenticate: remove extra UpdateUserInfo() call
The buildIdentityProfile() method is called only from Authenticate.getOAuthCallback(), which has previously called Authenticator.Authenticate(). It looks like all implementations of the Authenticator interface already call UpdateUserInfo(), so we shouldn't need to call UpdateUserInfo() a second time from buildIdentityProfile(). This should simplify the code a little and provide a slight performance improvement (by avoiding one network request).
This commit is contained in:
parent
1780fefa72
commit
59447ca039
1 changed files with 0 additions and 11 deletions
|
@ -29,19 +29,8 @@ func (a *Authenticate) buildIdentityProfile(
|
|||
claims identity.SessionClaims,
|
||||
oauthToken *oauth2.Token,
|
||||
) (*identitypb.Profile, error) {
|
||||
options := a.options.Load()
|
||||
idpID := r.FormValue(urlutil.QueryIdentityProviderID)
|
||||
|
||||
authenticator, err := a.cfg.getIdentityProvider(options, idpID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("authenticate: error getting identity provider authenticator: %w", err)
|
||||
}
|
||||
|
||||
err = authenticator.UpdateUserInfo(ctx, oauthToken, &claims)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("authenticate: error retrieving user info: %w", err)
|
||||
}
|
||||
|
||||
rawIDToken := []byte(claims.RawIDToken)
|
||||
rawOAuthToken, err := json.Marshal(oauthToken)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue