1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-06 00:03:29 +00:00

Generalize token refreshing to include reauth by api key (#456)

This commit is contained in:
Matt Gibson
2021-08-13 09:28:03 -04:00
committed by GitHub
parent 0180d0cce5
commit 1f0127966e
5 changed files with 96 additions and 22 deletions

View File

@@ -17,8 +17,9 @@ import { TokenService } from 'jslib-common/abstractions/token.service';
export class NodeApiService extends ApiService {
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService,
environmentService: EnvironmentService, logoutCallback: (expired: boolean) => Promise<void>,
customUserAgent: string = null) {
customUserAgent: string = null, apiKeyRefresh: (clientId: string, clientSecret: string) => Promise<any>) {
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent);
this.apiKeyRefresh = apiKeyRefresh;
}
nativeFetch(request: Request): Promise<Response> {