UNPKG

oauth-v2-client

Version:
21 lines (20 loc) 947 B
import { OauthClientConfig } from "../interfaces"; import JWTGrantOptions from "../interfaces/JWTGrantOptions"; import JWTGrantTokenFuncConfig from "../interfaces/JWTGrantTokenFuncConfig"; import RefreshTokenFuncConfig from "../interfaces/RefreshTokenFuncConfig"; import TokenRefreshable from "../interfaces/TokenRefreshable"; import GrantControl from "./GrantControl"; export default class JWTGrantControl extends GrantControl implements TokenRefreshable { private options; constructor(config: OauthClientConfig, options: JWTGrantOptions); /** * Get token with the authorization code extracted in the callback uri * @param params {GetAuthorizationTokenFuncConfig} parameters */ getToken<T = any>(params: JWTGrantTokenFuncConfig<T>): Promise<void>; /** * Refresh the token * @param params parameters */ refresh<T = any>(params: RefreshTokenFuncConfig<T>): Promise<void>; }