/** * CSRF Protection Service * * Handles CSRF token generation and validation for cookie-based authentication. * Uses cryptographically secure random tokens. */ import { NAuthConfig } from '../index'; import { NAuthCookieOptions } from '../platform/interfaces'; export declare class CsrfService { private readonly cookieName; private readonly headerName; private readonly cookieOptions; constructor(config: NAuthConfig); /** * Generate a new CSRF token * @returns Random 32-byte token as hex string */ generateToken(): string; /** * Validate CSRF token * Compares token from request header with token from cookie. * Uses constant-time comparison to prevent timing attacks. */ validateToken(headerToken: string, cookieToken: string): boolean; getCookieName(): string; getHeaderName(): string; getCookieOptions(): NAuthCookieOptions; } //# sourceMappingURL=csrf.service.d.ts.map