UNPKG

@stacksjs/stx

Version:

A performant UI Framework. Powered by Bun.

28 lines 838 B
/** * Generate a CSRF token */ export declare function generateCsrfToken(length?: number): string; /** * Get the current CSRF token, generating one if it doesn't exist */ export declare function getCsrfToken(): string; /** * Reset the CSRF token (mainly for testing) */ export declare function resetCsrfToken(): void; /** * Set a specific CSRF token (useful for server frameworks that have their own token generation) */ export declare function setCsrfToken(token: string): void; /** * Generate a CSRF input field HTML */ export declare function csrfField(inputName?: string): string; /** * Process @csrf directives in templates */ export declare function processCsrfDirectives(template: string): string; /** * Middleware-like function to verify CSRF token */ export declare function verifyCsrfToken(token: string): boolean;