import { NextRequest, NextResponse } from 'next/server'; import { A as AuthgearConfig } from './types-D6m4Hact.js'; export { D as DEFAULT_SCOPES, J as JWTPayload, O as OIDCConfiguration, P as Page, a as PromptOption, S as Session, b as SessionData, c as SessionState, T as TokenResponse, U as UserInfo } from './types-D6m4Hact.js'; /** * Creates Next.js route handlers for all Authgear auth endpoints. * * Usage in `app/api/auth/[...authgear]/route.ts`: * ```ts * import { createAuthgearHandlers } from "@authgear/nextjs"; * export const { GET, POST } = createAuthgearHandlers(config); * ``` * * Routes handled: * - GET /api/auth/login — Start OAuth flow * - GET /api/auth/callback — Handle OAuth callback * - GET /api/auth/logout — Logout and revoke tokens * - POST /api/auth/refresh — Refresh access token * - GET /api/auth/userinfo — Get current user info * - GET /api/auth/open — Open an Authgear page (e.g. /settings) for the current user */ declare function createAuthgearHandlers(config: AuthgearConfig): { GET: (request: NextRequest, { params }: { params: Promise<{ authgear: string[]; }>; }) => Promise; POST: (request: NextRequest, { params }: { params: Promise<{ authgear: string[]; }>; }) => Promise; }; export { AuthgearConfig, createAuthgearHandlers };