Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplateTag = "csrfField"
Functions ¶
func CSRF ¶
func CSRF() framework.Middleware
func RequireCSRF ¶
func RequireCSRF(f framework.RouteHandler) framework.RouteHandler
Decorator for framework.RouteHandler that checks the validity of the CSRF token by comparing the token in the form (hidden input) and the correct token in the session. It gives 403 Forbidden error if it is invalid and calls the given RouteHandler otherwise. E.g., router.Post("/login", csrf.RequireCSRF(performLogin)) where performLogin is of type framework.RouteHandler
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.