From 9cb8c3729890440767d6255f6aeab82515d22f24 Mon Sep 17 00:00:00 2001 From: TwiN Date: Sat, 8 Jan 2022 19:52:11 -0500 Subject: [PATCH] fix(security): Make sure to panic on start if the security middlewares return an error --- controller/handler/handler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/handler/handler.go b/controller/handler/handler.go index faaeeda4..d496bbd1 100644 --- a/controller/handler/handler.go +++ b/controller/handler/handler.go @@ -22,7 +22,9 @@ func CreateRouter(staticFolder string, securityConfig *security.Config, uiConfig if err := securityConfig.RegisterHandlers(router); err != nil { panic(err) } - securityConfig.ApplySecurityMiddleware(protected) + if err := securityConfig.ApplySecurityMiddleware(protected); err != nil { + panic(err) + } } // Endpoints unprotected.Handle("/v1/config", ConfigHandler{securityConfig: securityConfig}).Methods("GET")