@narangcia-oss/cryptic-auth-client-plain-ts
Version:
A TypeScript client for interacting with a cryptic-auth host web server, crafted by Narangcia OSS.
40 lines (39 loc) • 990 B
TypeScript
/**
* OAuth utility functions
*/
/**
* Generates a secure random state for OAuth CSRF protection
*/
export declare function generateOAuthState(): string;
/**
* Stores OAuth state securely for validation
*/
export declare function storeOAuthState(state: string): void;
/**
* Retrieves stored OAuth state for validation
*/
export declare function getStoredOAuthState(): string | null;
/**
* Clears stored OAuth state
*/
export declare function clearOAuthState(): void;
/**
* Validates OAuth state to prevent CSRF attacks
*/
export declare function validateOAuthState(receivedState: string): boolean;
/**
* Extracts OAuth callback parameters from URL
*/
export declare function extractOAuthParams(): {
code: string | null;
state: string | null;
error: string | null;
};
/**
* Checks if current URL is an OAuth callback
*/
export declare function isOAuthCallback(): boolean;
/**
* Cleans OAuth parameters from URL
*/
export declare function cleanOAuthUrl(): void;