From ce46fd70f2c555c73204f940b2b9a9b49098e49f Mon Sep 17 00:00:00 2001 From: DasSkelett Date: Tue, 15 Nov 2022 19:58:13 +0100 Subject: [PATCH] Fix nil pointer dereference without SessionStore config --- pkg/authnz/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/authnz/router.go b/pkg/authnz/router.go index 8c4263fa..e74b41f1 100644 --- a/pkg/authnz/router.go +++ b/pkg/authnz/router.go @@ -28,7 +28,7 @@ type AuthMiddleware struct { func New(config authconfig.AuthConfig, claimsMiddleware authsession.ClaimsMiddleware) (*AuthMiddleware, error) { router := mux.NewRouter() var storeSecret []byte - if config.SessionStore.Secret == "" { + if config.SessionStore == nil || config.SessionStore.Secret == "" { storeSecret = []byte(authutil.RandomString(32)) } else { var err error