Skip to content

csrf

csrf: (options?) => any

Defined in: http/csrf.js:53

Creates a CSRF token issuance and verification middleware.

CSRF configuration

any = {}

Cookie directives passed to the cookie factory

string = 'CSRF-TOKEN'

Cookie name for the CSRF token

string = 'CSRF-UUID'

Cookie name for the CSRF UUID

string

Token encoding (default: base64)

string = 'X-CSRF-TOKEN'

Request header name for the CSRF token

string

HMAC secret for token signing

any

  • Object with issue(req, res, ...rest) and verify(req, res, ...rest) methods; verify returns {response: {statusCode: 403}} when CSRF token verification fails