Files
livedash-node/app/api/csrf-token/route.ts
Kaj Kowalski 314326400e refactor: achieve 100% biome compliance with comprehensive code quality improvements
- Fix all cognitive complexity violations (63→0 errors)
- Replace 'any' types with proper TypeScript interfaces and generics
- Extract helper functions and custom hooks to reduce complexity
- Fix React hook dependency arrays and useCallback patterns
- Remove unused imports, variables, and functions
- Implement proper formatting across all files
- Add type safety with interfaces like AIProcessingRequestWithSession
- Fix circuit breaker implementation with proper reset() method
- Resolve all accessibility and form labeling issues
- Clean up mysterious './0' file containing biome output

Total: 63 errors → 0 errors, 42 warnings → 0 warnings
2025-07-12 00:28:12 +02:00

19 lines
488 B
TypeScript

/**
* CSRF Token API Endpoint
*
* This endpoint provides CSRF tokens to clients for secure form submissions.
* It generates a new token and sets it as an HTTP-only cookie.
*/
import { generateCSRFTokenResponse } from "../../../middleware/csrfProtection";
/**
* GET /api/csrf-token
*
* Generates and returns a new CSRF token.
* The token is also set as an HTTP-only cookie for automatic inclusion in requests.
*/
export function GET() {
return generateCSRFTokenResponse();
}