react-oauth2-code-pkce
Version:
Provider agnostic react package for OAuth2 Authorization Code flow with PKCE
10 lines (9 loc) • 504 B
TypeScript
import type { TTokenResponse } from './types';
export declare const FALLBACK_EXPIRE_TIME = 600;
export declare const epochAtSecondsFromNow: (secondsFromNow: number | string) => number;
/**
* Check if the Access Token has expired.
* Will return True if the token has expired, OR there is less than 30 seconds until it expires.
*/
export declare function epochTimeIsPast(timestamp: number): boolean;
export declare function getRefreshExpiresIn(tokenExpiresIn: number, response: TTokenResponse): number;