mirror of
https://github.com/bitwarden/browser
synced 2025-12-29 06:33:40 +00:00
EC-134 Fix api token refresh (#749)
* Fix apikey token refresh * Refactor: use class for TokenRequestTwoFactor
This commit is contained in:
@@ -2,6 +2,7 @@ import * as FormData from "form-data";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import * as fe from "node-fetch";
|
||||
|
||||
import { AppIdService } from "jslib-common/abstractions/appId.service";
|
||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||
import { TokenService } from "jslib-common/abstractions/token.service";
|
||||
@@ -18,12 +19,18 @@ export class NodeApiService extends ApiService {
|
||||
tokenService: TokenService,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
environmentService: EnvironmentService,
|
||||
appIdService: AppIdService,
|
||||
logoutCallback: (expired: boolean) => Promise<void>,
|
||||
customUserAgent: string = null,
|
||||
apiKeyRefresh: (clientId: string, clientSecret: string) => Promise<any>
|
||||
customUserAgent: string = null
|
||||
) {
|
||||
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent);
|
||||
this.apiKeyRefresh = apiKeyRefresh;
|
||||
super(
|
||||
tokenService,
|
||||
platformUtilsService,
|
||||
environmentService,
|
||||
appIdService,
|
||||
logoutCallback,
|
||||
customUserAgent
|
||||
);
|
||||
}
|
||||
|
||||
nativeFetch(request: Request): Promise<Response> {
|
||||
|
||||
Reference in New Issue
Block a user