@daystram/ratify-client
Version:
Ratify OAuth Client
28 lines (27 loc) • 857 B
TypeScript
import { AxiosResponse } from "axios";
import { ITokenStorage } from "./storage/ITokenStorage";
import { User } from "./User";
export interface RatifyClientOptions {
clientId: string;
redirectUri: string;
issuer: string;
storage: ITokenStorage;
}
export declare class RatifyClient {
private options;
private storageManager;
private oauth;
constructor(opts: RatifyClientOptions);
isAuthenticated(): boolean;
_accessTokenValid(): boolean;
getToken(tokenKey: string): string;
getUser(): User;
reset(): void;
authorize(immediate?: boolean, scopes?: string[]): void;
redeemToken(authorizationCode: string): Promise<AxiosResponse>;
logout(global?: boolean): Promise<void>;
getState(): string;
checkState(state: string): boolean;
getCodeChallenge(): string;
getCodeVerifier(): any;
}