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 Zahary Karadjov
parent 3514d39fd2
commit baf38c3416
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609

View File

@ -435,7 +435,9 @@ proc init*(T: type BeaconNode,
quit 1
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(
string(config.dataDir), config.jwtSecret)
if jwtSecret.isErr: