@@ -98,6 +98,7 @@ import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarde
9898import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/services/key-connector.service" ;
9999import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction" ;
100100import { MasterPasswordService } from "@bitwarden/common/key-management/master-password/services/master-password.service" ;
101+ import { PinStateService } from "@bitwarden/common/key-management/pin/pin-state.service.implementation" ;
101102import { PinServiceAbstraction } from "@bitwarden/common/key-management/pin/pin.service.abstraction" ;
102103import { PinService } from "@bitwarden/common/key-management/pin/pin.service.implementation" ;
103104import { SecurityStateService } from "@bitwarden/common/key-management/security-state/abstractions/security-state.service" ;
@@ -709,18 +710,7 @@ export default class MainBackground {
709710
710711 this . kdfConfigService = new DefaultKdfConfigService ( this . stateProvider ) ;
711712
712- this . pinService = new PinService (
713- this . accountService ,
714- this . cryptoFunctionService ,
715- this . encryptService ,
716- this . kdfConfigService ,
717- this . keyGenerationService ,
718- this . logService ,
719- this . stateProvider ,
720- ) ;
721-
722713 this . keyService = new DefaultKeyService (
723- this . pinService ,
724714 this . masterPasswordService ,
725715 this . keyGenerationService ,
726716 this . cryptoFunctionService ,
@@ -733,6 +723,19 @@ export default class MainBackground {
733723 this . kdfConfigService ,
734724 ) ;
735725
726+ const pinStateService = new PinStateService ( this . stateProvider ) ;
727+
728+ this . pinService = new PinService (
729+ this . accountService ,
730+ this . encryptService ,
731+ this . kdfConfigService ,
732+ this . keyGenerationService ,
733+ this . logService ,
734+ this . keyService ,
735+ this . sdkService ,
736+ pinStateService ,
737+ ) ;
738+
736739 this . appIdService = new AppIdService ( this . storageService , this . logService ) ;
737740
738741 this . userDecryptionOptionsService = new UserDecryptionOptionsService ( this . stateProvider ) ;
@@ -741,7 +744,7 @@ export default class MainBackground {
741744
742745 this . vaultTimeoutSettingsService = new DefaultVaultTimeoutSettingsService (
743746 this . accountService ,
744- this . pinService ,
747+ pinStateService ,
745748 this . userDecryptionOptionsService ,
746749 this . keyService ,
747750 this . tokenService ,
@@ -759,6 +762,7 @@ export default class MainBackground {
759762 this . biometricStateService ,
760763 this . messagingService ,
761764 this . vaultTimeoutSettingsService ,
765+ this . pinService ,
762766 ) ;
763767
764768 this . apiService = new ApiService (
@@ -1681,9 +1685,9 @@ export default class MainBackground {
16811685 this . keyService . clearKeys ( userBeingLoggedOut ) ,
16821686 this . cipherService . clear ( userBeingLoggedOut ) ,
16831687 this . folderService . clear ( userBeingLoggedOut ) ,
1684- this . vaultTimeoutSettingsService . clear ( userBeingLoggedOut ) ,
16851688 this . biometricStateService . logout ( userBeingLoggedOut ) ,
16861689 this . popupViewCacheBackgroundService . clearState ( ) ,
1690+ this . pinService . logout ( userBeingLoggedOut ) ,
16871691 /* We intentionally do not clear:
16881692 * - autofillSettingsService
16891693 * - badgeSettingsService
0 commit comments