UNPKG

oauth-v2-client

Version:
21 lines (20 loc) 890 B
import { OauthClientConfig } from "../interfaces"; import PasswordGrantFuncConfig from "../interfaces/PasswordGrantFuncConfig"; import PasswordGrantOptions from "../interfaces/PasswordGrantOptions"; import RefreshTokenFuncConfig from "../interfaces/RefreshTokenFuncConfig"; import TokenRefreshable from "../interfaces/TokenRefreshable"; import GrantControl from "./GrantControl"; export default class PasswordGrantControl extends GrantControl implements TokenRefreshable { private options; constructor(config: OauthClientConfig, options: PasswordGrantOptions); /** * Get Password Grant Token * @param params parameters */ getToken<T = any>(params: PasswordGrantFuncConfig<T>): Promise<void>; /** * Refresh the token * @param params parameters */ refresh<T = any>(params: RefreshTokenFuncConfig<T>): Promise<void>; }