fix(security): Make sure to panic on start if the security middlewares return an error

This commit is contained in:
TwiN 2022-01-08 19:52:11 -05:00
parent f6f7e15735
commit 9cb8c37298

View File

@ -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")