@civic/nexus-bridge
Version:
Stdio <-> HTTP/SSE MCP bridge with Civic auth handling
42 lines • 1.19 kB
TypeScript
/**
* Handles the complete OAuth flow including browser opening, callback receiving, and token processing.
*/
import type { Tokens } from "./types.js";
/**
* Result from the authentication flow
*/
export interface AuthResult extends Tokens {
success: boolean;
error?: string;
errorDescription?: string;
}
/**
* A simple, reliable callback server for handling OAuth flows
*/
export declare class CallbackServer {
private server;
private app;
private callbackPath;
private codeVerifier;
private redirectUri;
private _resolveAuthResult;
/**
* Create a new callback server instance
* @param codeVerifier PKCE code verifier to use during token exchange
*/
constructor(codeVerifier: string);
/**
* Starts the OAuth flow by starting the server and opening the browser
* @returns Promise that resolves with the authentication result
*/
startAuthFlow(authUrl: string): Promise<AuthResult>;
/**
* Starts the HTTP server on an available port
*/
private startServer;
/**
* Handles the OAuth callback request
*/
private handleCallback;
}
//# sourceMappingURL=callbackServer.d.ts.map