1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

feat(new-device-verification-screen): (Auth) [PM-17489] Back Button on New Device Verification Screen (#16599)

On Web and Desktop, show back button on `NewDeviceVerificationComponent` (route `/device-verification`). Do not show it on Extension, because Extension already has a back button in the header.
This commit is contained in:
rr-bw
2025-10-01 12:57:41 -07:00
committed by GitHub
parent 420b26776b
commit cae58232e5
10 changed files with 109 additions and 4 deletions

View File

@@ -0,0 +1,21 @@
import { ExtensionNewDeviceVerificationComponentService } from "./extension-new-device-verification-component.service";
describe("ExtensionNewDeviceVerificationComponentService", () => {
let sut: ExtensionNewDeviceVerificationComponentService;
beforeEach(() => {
sut = new ExtensionNewDeviceVerificationComponentService();
});
it("should instantiate the service", () => {
expect(sut).not.toBeFalsy();
});
describe("showBackButton()", () => {
it("should return false", () => {
const result = sut.showBackButton();
expect(result).toBe(false);
});
});
});

View File

@@ -0,0 +1,13 @@
import {
DefaultNewDeviceVerificationComponentService,
NewDeviceVerificationComponentService,
} from "@bitwarden/auth/angular";
export class ExtensionNewDeviceVerificationComponentService
extends DefaultNewDeviceVerificationComponentService
implements NewDeviceVerificationComponentService
{
showBackButton() {
return false;
}
}

View File

@@ -29,6 +29,7 @@ import {
TwoFactorAuthDuoComponentService,
TwoFactorAuthWebAuthnComponentService,
SsoComponentService,
NewDeviceVerificationComponentService,
} from "@bitwarden/auth/angular";
import {
LockService,
@@ -36,6 +37,7 @@ import {
SsoUrlService,
LogoutService,
} from "@bitwarden/auth/common";
import { ExtensionNewDeviceVerificationComponentService } from "@bitwarden/browser/auth/services/new-device-verification/extension-new-device-verification-component.service";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { EventCollectionService as EventCollectionServiceAbstraction } from "@bitwarden/common/abstractions/event/event-collection.service";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
@@ -710,6 +712,11 @@ const safeProviders: SafeProvider[] = [
useClass: DefaultCipherArchiveService,
deps: [CipherService, ApiService, BillingAccountProfileStateService, ConfigService],
}),
safeProvider({
provide: NewDeviceVerificationComponentService,
useClass: ExtensionNewDeviceVerificationComponentService,
deps: [],
}),
];
@NgModule({