csrf

package
v0.0.0-...-747cc42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateTag = "csrfField"

Functions

func CSRF

func CSRF() framework.Middleware

func RequireCSRF

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

func TemplateField

func TemplateField(cxt framework.Context) template.HTML

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL