mirror of
https://github.com/bitwarden/browser
synced 2026-02-11 22:13:32 +00:00
Revert changes to v1 components
This commit is contained in:
@@ -5,7 +5,6 @@ import { mock, MockProxy } from "jest-mock-extended";
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
|
||||
import { WINDOW } from "@bitwarden/angular/services/injection-tokens";
|
||||
import { TwoFactorFormCacheService } from "@bitwarden/auth/angular";
|
||||
import {
|
||||
LoginStrategyServiceAbstraction,
|
||||
LoginEmailServiceAbstraction,
|
||||
@@ -73,7 +72,6 @@ describe("TwoFactorComponent", () => {
|
||||
let mockMasterPasswordService: FakeMasterPasswordService;
|
||||
let mockAccountService: FakeAccountService;
|
||||
let mockToastService: MockProxy<ToastService>;
|
||||
let mockTwoFactorFormCacheService: MockProxy<TwoFactorFormCacheService>;
|
||||
|
||||
let mockUserDecryptionOpts: {
|
||||
noMasterPassword: UserDecryptionOptions;
|
||||
@@ -110,11 +108,6 @@ describe("TwoFactorComponent", () => {
|
||||
mockAccountService = mockAccountServiceWith(userId);
|
||||
mockToastService = mock<ToastService>();
|
||||
mockMasterPasswordService = new FakeMasterPasswordService();
|
||||
mockTwoFactorFormCacheService = mock<TwoFactorFormCacheService>();
|
||||
|
||||
// Setup form cache service mock with necessary observables
|
||||
mockTwoFactorFormCacheService.isEnabled$.mockReturnValue(new BehaviorSubject(false));
|
||||
mockTwoFactorFormCacheService.formData$.mockReturnValue(new BehaviorSubject(null));
|
||||
|
||||
mockUserDecryptionOpts = {
|
||||
noMasterPassword: new UserDecryptionOptions({
|
||||
@@ -197,7 +190,6 @@ describe("TwoFactorComponent", () => {
|
||||
{ provide: InternalMasterPasswordServiceAbstraction, useValue: mockMasterPasswordService },
|
||||
{ provide: AccountService, useValue: mockAccountService },
|
||||
{ provide: ToastService, useValue: mockToastService },
|
||||
{ provide: TwoFactorFormCacheService, useValue: mockTwoFactorFormCacheService },
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import { firstValueFrom } from "rxjs";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
import { WINDOW } from "@bitwarden/angular/services/injection-tokens";
|
||||
import { TwoFactorFormCacheService } from "@bitwarden/auth/angular";
|
||||
import {
|
||||
LoginStrategyServiceAbstraction,
|
||||
LoginEmailServiceAbstraction,
|
||||
@@ -100,7 +99,6 @@ export class TwoFactorComponentV1 extends CaptchaProtectedComponent implements O
|
||||
protected masterPasswordService: InternalMasterPasswordServiceAbstraction,
|
||||
protected accountService: AccountService,
|
||||
protected toastService: ToastService,
|
||||
protected twoFactorFormCacheService: TwoFactorFormCacheService,
|
||||
) {
|
||||
super(environmentService, i18nService, platformUtilsService, toastService);
|
||||
|
||||
@@ -439,10 +437,6 @@ export class TwoFactorComponentV1 extends CaptchaProtectedComponent implements O
|
||||
return;
|
||||
}
|
||||
|
||||
if ((await this.twoFactorFormCacheService.getFormData()).emailSent) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((await this.loginStrategyService.getEmail()) == null) {
|
||||
this.toastService.showToast({
|
||||
variant: "error",
|
||||
|
||||
Reference in New Issue
Block a user