Documentation
¶
Overview ¶
Package csrf provides experimental CSRF token helpers for templates.
Index ¶
Constants ¶
View Source
const DefaultTokenKey = "X-CSRF-Token"
DefaultTokenKey is the default form/header name used by fallback tokens.
Variables ¶
This section is empty.
Functions ¶
func Stage ¶
func Stage() partial.RenderStage
Stage gives templates the csrf helper from the render context. It is made only for the templates that call it.
Types ¶
type Token ¶
Token describes the CSRF token exposed to templates.
func CSRF ¶
func CSRF(ctx ...*partial.RenderContext) Token
CSRF returns the configured token for a render context.
go-doc:sig func() github.com/donseba/go-partial/exp/csrf.Token
func FromContext ¶
FromContext returns the configured Token or an invalid fallback token.
Click to show internal directories.
Click to hide internal directories.