/** * Auth Middleware Factory * Creates middleware for protecting routes with authentication */ import { NextResponse } from 'next/server'; import type { NextRequest } from 'next/server'; export interface AuthMiddlewareConfig { /** Routes that require authentication */ protectedRoutes?: string[]; /** Routes that require admin privileges */ adminRoutes?: string[]; /** Login page URL */ loginUrl?: string; /** Routes to exclude from auth checks */ excludeRoutes?: string[]; /** Callback after successful auth check */ onAuthSuccess?: (user: any, request: NextRequest) => NextResponse | void; /** Callback after failed auth check */ onAuthFailure?: (request: NextRequest) => NextResponse | void; /** Enable debug logging */ debug?: boolean; } export declare function createAuthMiddleware(config?: AuthMiddlewareConfig): (request: NextRequest) => Promise>; /** * Create middleware for admin routes only */ export declare function createAdminMiddleware(config: Omit & { adminRoutes: string[]; }): (request: NextRequest) => Promise>; /** * Simple auth middleware for common patterns */ export declare function createSimpleAuthMiddleware(options: { adminPaths: string[]; loginPath?: string; excludePaths?: string[]; debug?: boolean; }): (request: NextRequest) => Promise>; /** * Matcher configuration helper */ export declare function createAuthMatcher(config: { adminPaths?: string[]; protectedPaths?: string[]; locales?: string[]; }): string[]; //# sourceMappingURL=auth-middleware.d.ts.map