UNPKG

@narangcia-oss/cryptic-auth-client-plain-ts

Version:

A TypeScript client for interacting with a cryptic-auth host web server, crafted by Narangcia OSS.

34 lines (33 loc) 1.01 kB
import type { AuthClient } from "../core/client"; import type { AuthTokens } from "../types"; export interface OAuthCallbackResult { success: boolean; tokens?: AuthTokens; error?: string; } /** * Core OAuth callback handler - framework agnostic * Handles the OAuth callback flow logic without any UI dependencies */ export declare class OAuthCallbackHandler { private authClient; constructor(authClient: AuthClient); /** * Checks if the current URL is an OAuth callback URL */ isOAuthCallback(): boolean; /** * Processes the OAuth callback from the current URL * Returns the result without any UI side effects */ processCallback(): Promise<OAuthCallbackResult>; /** * Extracts the OAuth provider from the current URL * Override this method for custom provider detection logic */ protected extractProviderFromUrl(): string; /** * Cleans the OAuth parameters from the current URL */ cleanUrl(): void; }