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:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
DefaultNewDeviceVerificationComponentService,
|
||||
NewDeviceVerificationComponentService,
|
||||
} from "@bitwarden/auth/angular";
|
||||
|
||||
export class ExtensionNewDeviceVerificationComponentService
|
||||
extends DefaultNewDeviceVerificationComponentService
|
||||
implements NewDeviceVerificationComponentService
|
||||
{
|
||||
showBackButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user