Documentation
¶
Index ¶
- func New(options ...Option) route.Middleware
- func Token(ctx *route.Context) string
- type Config
- type Option
- func Cookie(name string) Option
- func Domain(domain string) Option
- func Field(name string) Option
- func HTTPOnly(value bool) Option
- func Header(name string) Option
- func MaxAge(seconds int) Option
- func Next(fn func(*route.Context) bool) Option
- func OnError(fn func(*route.Context) error) Option
- func Path(path string) Option
- func SameSite(mode http.SameSite) Option
- func Secure(value bool) Option
- func SkipPaths(paths ...string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Next func(*route.Context) bool
CookieName string
HeaderName string
FormField string
CookiePath string
CookieDomain string
Secure bool
HTTPOnly bool
SameSite http.SameSite
MaxAge int
SkipPaths []string
OnError func(*route.Context) error
}
Config configures CSRF middleware.
type Option ¶
type Option func(*Config)
Option configures CSRF middleware.
Click to show internal directories.
Click to hide internal directories.