review feedback -- additional potential races
This commit is contained in:
parent
2067a740cc
commit
8e6a8fae1f
2 changed files with 7 additions and 4 deletions
|
@ -154,7 +154,9 @@ func NewRelyingPartyOAuth(config *oauth2.Config, options ...Option) (RelyingPart
|
|||
}
|
||||
}
|
||||
|
||||
_ = rp.IDTokenVerifier()
|
||||
// avoid races by calling these early
|
||||
_ = rp.IDTokenVerifier() // sets idTokenVerifier
|
||||
_ = rp.ErrorHandler() // sets errorHandler
|
||||
|
||||
return rp, nil
|
||||
}
|
||||
|
|
|
@ -167,9 +167,10 @@ func NewOpenIDProvider(ctx context.Context, config *Config, storage Storage, opO
|
|||
o.crypto = NewAESCrypto(config.CryptoKey)
|
||||
|
||||
// Avoid potential race conditions by calling these early
|
||||
_ = o.AccessTokenVerifier()
|
||||
_ = o.JWTProfileVerifier()
|
||||
_ = o.openIDKeySet()
|
||||
_ = o.AccessTokenVerifier() // sets accessTokenVerifier
|
||||
_ = o.IDTokenHintVerifier() // sets idTokenHintVerifier
|
||||
_ = o.JWTProfileVerifier() // sets jwtProfileVerifier
|
||||
_ = o.openIDKeySet() // sets keySet
|
||||
|
||||
return o, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue