UNPKG

nuxt-csurf

Version:

Nuxt Cross-Site Request Forgery (CSRF) Prevention

43 lines (38 loc) 1.16 kB
import * as _nuxt_schema from '@nuxt/schema'; import { EncryptAlgorithm } from 'uncsrf'; interface CookieSerializeOptions { domain?: string | undefined; encode?(value: string): string; expires?: Date | undefined; httpOnly?: boolean | undefined; maxAge?: number | undefined; path?: string | undefined; sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined; secure?: boolean | undefined; } interface ModuleOptions { https?: boolean; cookie?: CookieSerializeOptions; cookieKey?: string; methodsToProtect?: Array<string>; encryptSecret?: string; encryptAlgorithm?: EncryptAlgorithm; addCsrfTokenToEventCtx?: boolean; enabled?: boolean; headerName?: string; } declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>; declare module '@nuxt/schema' { interface RuntimeConfig { csurf: ModuleOptions; } interface PublicRuntimeConfig { csurf: Pick<ModuleOptions, 'headerName'>; } } declare module 'nitropack' { interface NitroRouteConfig { csurf?: Partial<ModuleOptions> | false; } } export { type ModuleOptions, _default as default };