diff --git a/setup.go b/setup.go index 0a3fbd9..f43dac2 100644 --- a/setup.go +++ b/setup.go @@ -27,10 +27,14 @@ func setup() { return } - // Set the JWT Secret secret = os.Getenv("JWT_SECRET") if secret == "" { - panic("No JWT secret was set!") + token, err := n.Request("config.get.jwt_token", []byte(""), 1*time.Second) + if err != nil { + panic("Can't get jwt_config config") + } + + secret = string(token.Data) } cfg := monitorConfig{}