UNPKG

@piggly/fastify-chassis

Version:

An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.

19 lines (18 loc) 757 B
import type { FastifyRequest, FastifyReply } from 'fastify'; import type { CSRFTokenService, CookieOptions } from '../services'; /** * CSRFCookieIssuerRoute is a route that issues a CSRF token as a cookie. * * It will return a 204 status code and a CSRF token as a cookie. * * @param {Object} deps * @param {CSRFTokenService} deps.CSRF_SERVICE * @param {string} [name] The name of the cookie. * @param {CookieOptions} [options] The options of the cookie. * @returns Route handler. * @since 7.0.0 * @author Caique Araujo <caique@piggly.com.br> */ export declare const CSRFCookieIssuerRoute: (deps: { CSRF_SERVICE: CSRFTokenService; }, name?: string, options?: CookieOptions) => (request: FastifyRequest, reply: FastifyReply) => Promise<any>;