From 837ce2514f2f1984e2266184ac61a62dfe9bbfef Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Wed, 19 Jun 2019 12:47:24 +0200 Subject: [PATCH] Generate JWT secret when env var is empty --- pkg/cli/options/jwt.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/cli/options/jwt.go b/pkg/cli/options/jwt.go index 6cfb23cda..aefc81e9a 100644 --- a/pkg/cli/options/jwt.go +++ b/pkg/cli/options/jwt.go @@ -15,13 +15,15 @@ type ( func JWT(pfix string) (o *JWTOpt) { o = &JWTOpt{ - // Setting JWT secret to random string to prevent security accidents... - Secret: string(rand.Bytes(32)), - Expiry: time.Hour * 24 * 30, } fill(o, pfix) + // Setting JWT secret to random string to prevent security accidents... + if o.Secret == "" { + o.Secret = string(rand.Bytes(32)) + } + return }