@flexbase/http-client-middleware
Version:
Http client middleware
13 lines (12 loc) • 720 B
TypeScript
import { AuthenticationToken } from './authentication.token.js';
import { AuthenticationTokenAccessor } from './authentication.token.accessor.js';
/** @ignore */
export declare abstract class AuthenticationTokenAccessorBase<Credentials> implements AuthenticationTokenAccessor<Credentials> {
validateToken(token: AuthenticationToken | null): Promise<boolean>;
protected abstract generateBody(credentials: Credentials, refreshToken: string | undefined): {
url: string;
body: Record<string, any>;
};
protected coerceResponse(tokenResponse: any): AuthenticationToken | null;
requestToken(credentials: Credentials, refreshToken: string | undefined): Promise<AuthenticationToken | null>;
}