@zestic/oauth-core
Version:
Framework-agnostic OAuth authentication library with support for multiple OAuth flows
44 lines • 1.84 kB
TypeScript
/**
* Base Magic Link Flow Handler
* Abstract base class for all magic link flow implementations
*/
import { BaseCallbackFlowHandler } from './BaseCallbackFlowHandler';
import { OAuthConfig, OAuthAdapters, OAuthResult } from '../types/OAuthTypes';
export declare abstract class BaseMagicLinkFlowHandler extends BaseCallbackFlowHandler {
abstract readonly name: string;
readonly priority: 25;
/**
* Check if this handler can process the given parameters
* Subclasses should override this to add flow-specific checks
*/
protected hasRequiredMagicLinkParams(params: URLSearchParams): boolean;
/**
* Check if this flow is disabled in config
*/
protected isFlowDisabled(config: OAuthConfig): boolean;
/**
* Validate the magic link flow parameters
*/
validate(params: URLSearchParams, config: OAuthConfig): Promise<boolean>;
/**
* Handle the magic link flow - shared implementation for all magic link flows
*/
handle(params: URLSearchParams, adapters: OAuthAdapters, config: OAuthConfig): Promise<OAuthResult>;
/**
* Extract token from parameters
*/
protected extractToken(params: URLSearchParams): string;
/**
* Build additional parameters for token exchange
*/
protected buildAdditionalParams(params: URLSearchParams, flow: string | undefined, adapters: OAuthAdapters): Promise<Record<string, string>>;
/**
* Validate state parameter
*/
protected validateState(state: string, adapters: OAuthAdapters): Promise<void>;
/**
* Exchange magic link token for OAuth tokens
*/
protected exchangeMagicLinkToken(token: string, additionalParams: Record<string, string>, adapters: OAuthAdapters, config: OAuthConfig): Promise<OAuthResult>;
}
//# sourceMappingURL=BaseMagicLinkFlowHandler.d.ts.map