Skip to content

Commit 4af08d0

Browse files
[PM-21681] Stop syncing TOTP codes with BWA on PM logout (#1600)
1 parent eb7c4e5 commit 4af08d0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

BitwardenShared/Core/Auth/Repositories/AuthRepository.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ extension DefaultAuthRepository: AuthRepository {
760760
let userId = try await stateService.getAccountIdOrActiveId(userId: userId)
761761

762762
// Clear all user data.
763+
try await stateService.setSyncToAuthenticator(false, userId: userId)
763764
try await biometricsRepository.setBiometricUnlockKey(authKey: nil)
764765
try await keychainService.deleteItems(for: userId)
765766
await vaultTimeoutService.remove(userId: userId)

BitwardenShared/Core/Auth/Repositories/AuthRepositoryTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,7 @@ class AuthRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo
20852085
biometricsRepository.setBiometricUnlockKeyError = nil
20862086
stateService.pinProtectedUserKeyValue["1"] = "1"
20872087
stateService.encryptedPinByUserId["1"] = "1"
2088+
stateService.syncToAuthenticatorByUserId["1"] = true
20882089

20892090
try await subject.logout(userInitiated: true)
20902091

@@ -2095,6 +2096,7 @@ class AuthRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo
20952096
XCTAssertEqual(vaultTimeoutService.removedIds, [anneAccount.profile.userId])
20962097
XCTAssertEqual(stateService.pinProtectedUserKeyValue["1"], "1")
20972098
XCTAssertEqual(stateService.encryptedPinByUserId["1"], "1")
2099+
XCTAssertEqual(stateService.syncToAuthenticatorByUserId["1"], false)
20982100
}
20992101

21002102
/// `logout` successfully logs out a user clearing pins because of policy Remove unlock with pin being enabled.

0 commit comments

Comments
 (0)