Added CSRF.

This commit is contained in:
mikestefanello 2021-12-03 07:53:01 -05:00
parent 1f258ea17e
commit 60d434a922
4 changed files with 14 additions and 0 deletions

View file

@ -26,6 +26,9 @@ func BuildRouter(c *container.Container) {
// TODO: needs cache control headers
c.Web.Use(middleware.Static(StaticDir))
c.Web.Use(session.Middleware(sessions.NewCookieStore([]byte(c.Config.App.EncryptionKey))))
c.Web.Use(middleware.CSRFWithConfig(middleware.CSRFConfig{
TokenLookup: "form:csrf",
}))
// Base controller
ctr := controllers.NewController(c)