/** * OAuth Callback Handler * * Handles the OAuth 2.0 callback from the provider by: * 1. Validating the state parameter to prevent CSRF attacks * 2. Exchanging the authorization code for an access token * 3. Fetching the user profile from the provider * 4. Calling the onAuthSuccess callback to create/link user and generate JWT token * 5. Optionally storing the OAuth connection (if storeTokens enabled) * 6. Returning the JWT token to the client (via JSON or redirect) * * Route: GET /oauth/:provider/callback?code=...&state=...&response_type=json */ import { GetHandler, RouteProps } from "@flink-app/flink"; import CallbackRequest from "../schemas/CallbackRequest"; /** * Path parameters for the handler */ interface PathParams { provider: string; [key: string]: string; } /** * Route configuration * Note: This handler is registered programmatically by the plugin * with dynamic provider parameter support */ export declare const Route: RouteProps; /** * OAuth Callback Handler * * Completes the OAuth flow by exchanging the authorization code for tokens, * fetching user profile, calling the app's onAuthSuccess callback to generate * JWT token, and returning the token to the client. */ declare const CallbackOAuth: GetHandler; export default CallbackOAuth;