import { NextRequest, NextResponse } from 'next/server'; interface AuthRouteConfig { /** * Base URL of your Insforge backend */ baseUrl: string; /** * Cookie max age in seconds (default: 7 days) * @default 604800 */ cookieMaxAge?: number; /** * Whether to use secure cookies (HTTPS only) * Auto-detected based on environment */ secure?: boolean; } interface AuthRouteHandlers { POST: (request: NextRequest) => Promise; GET: (request: NextRequest) => Promise; DELETE: (request: NextRequest) => Promise; } /** * Creates authentication route handlers for Next.js App Router * These handlers set HTTP-only cookies that can be read by middleware * * @example * ```ts * // app/api/auth/[...auth]/route.ts * import { createAuthRouteHandlers } from '@insforge/nextjs/api'; * * const handlers = createAuthRouteHandlers({ * baseUrl: process.env.NEXT_PUBLIC_INSFORGE_BASE_URL!, * }); * * export const POST = handlers.POST; * export const GET = handlers.GET; * export const DELETE = handlers.DELETE; * ``` */ declare function createAuthRouteHandlers(config: AuthRouteConfig): AuthRouteHandlers; export { type AuthRouteConfig, createAuthRouteHandlers };