Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefault = Config{ Next: nil, TokenLookup: "header:X-CSRF-Token", ContextKey: "csrf", Cookie: &fiber.Cookie{ Name: "_csrf", SameSite: "Strict", }, Expiration: 24 * time.Hour, CookieExpires: 24 * time.Hour, }
ConfigDefault is the default config
Functions ¶
Types ¶
type Config ¶
type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // TokenLookup is a string in the form of "<source>:<key>" that is used // to extract token from the request. // // Optional. Default value "header:X-CSRF-Token". // Possible values: // - "header:<name>" // - "query:<name>" // - "param:<name>" // - "form:<name>" // - "cookie:<name>" TokenLookup string // Cookie // // Optional. Cookie *fiber.Cookie // Deprecated, please use Expiration CookieExpires time.Duration // Expiration is the duration before csrf token will expire // // Optional. Default: 24 * time.Hour Expiration time.Duration // Context key to store generated CSRF token into context. // // Optional. Default value "csrf". ContextKey string }
Config defines the config for middleware.
Click to show internal directories.
Click to hide internal directories.