mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 18:32:10 +01:00
- Fix 36+ biome linting issues reducing errors/warnings from 227 to 191 - Replace explicit 'any' types with proper TypeScript interfaces - Fix React hooks dependencies and useCallback patterns - Resolve unused variables and parameter assignment issues - Improve accessibility with proper label associations - Add comprehensive API documentation for admin and security features - Update README.md with accurate PostgreSQL setup and current tech stack - Create complete documentation for audit logging, CSP monitoring, and batch processing - Fix outdated project information and missing developer workflows
20 lines
536 B
TypeScript
20 lines
536 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 type { NextRequest } from "next/server";
|
|
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();
|
|
}
|