From 1e9a557494dd7c852ffe0a6eaef275b70552c72a Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 1 Apr 2022 11:50:48 +1000 Subject: [PATCH] EC-134 Fix api token refresh (#517) * Update dependencies * Update jslib --- jslib | 2 +- src/bw.ts | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/jslib b/jslib index 15ad2ca3ea..e595c0548e 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 15ad2ca3ea92e6a6969f70acb2885dfb89ca7540 +Subproject commit e595c0548ed1a481dbd024ec66975e3a453bd471 diff --git a/src/bw.ts b/src/bw.ts index 98fa3684f6..424b635035 100644 --- a/src/bw.ts +++ b/src/bw.ts @@ -10,7 +10,6 @@ import { LogLevelType } from "jslib-common/enums/logLevelType"; import { StateFactory } from "jslib-common/factories/stateFactory"; import { Account } from "jslib-common/models/domain/account"; import { GlobalState } from "jslib-common/models/domain/globalState"; -import { ApiLogInCredentials } from "jslib-common/models/domain/logInCredentials"; import { AppIdService } from "jslib-common/services/appId.service"; import { AuditService } from "jslib-common/services/audit.service"; import { AuthService } from "jslib-common/services/auth.service"; @@ -155,18 +154,20 @@ export class Main { this.tokenService = new TokenService(this.stateService); this.messagingService = new NoopMessagingService(); this.environmentService = new EnvironmentService(this.stateService); + + const customUserAgent = + "Bitwarden_CLI/" + + this.platformUtilsService.getApplicationVersionSync() + + " (" + + this.platformUtilsService.getDeviceString().toUpperCase() + + ")"; this.apiService = new NodeApiService( this.tokenService, this.platformUtilsService, this.environmentService, + this.appIdService, async (expired: boolean) => await this.logout(), - "Bitwarden_CLI/" + - this.platformUtilsService.getApplicationVersionSync() + - " (" + - this.platformUtilsService.getDeviceString().toUpperCase() + - ")", - (clientId, clientSecret) => - this.authService.logIn(new ApiLogInCredentials(clientId, clientSecret)) + customUserAgent ); this.containerService = new ContainerService(this.cryptoService);