use JWT when and only when the user specifies a JWT secret explicitly (#3786)

This commit is contained in:
tersec 2022-06-22 15:44:00 +00:00 committed by GitHub
parent 4bb42eea7d
commit 4908ba7c13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -435,7 +435,9 @@ proc init*(T: type BeaconNode,
quit 1 quit 1
let optJwtSecret = let optJwtSecret =
if cfg.BELLATRIX_FORK_EPOCH != FAR_FUTURE_EPOCH: # Some Web3 endpoints aren't compatible with JWT, but if explicitly chosen,
# use it regardless.
if config.jwtSecret.isSome:
let jwtSecret = rng[].checkJwtSecret( let jwtSecret = rng[].checkJwtSecret(
string(config.dataDir), config.jwtSecret) string(config.dataDir), config.jwtSecret)
if jwtSecret.isErr: if jwtSecret.isErr: