1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-11393] Remove the need for TotpCaptureService in Autofill Options View component (#11093)

This commit is contained in:
Shane Melton
2024-09-17 13:15:11 -07:00
committed by GitHub
parent 1a961ee294
commit 99ba56785d
5 changed files with 7 additions and 32 deletions

View File

@@ -1,8 +1,3 @@
/**
* TODO: PM-10727 - Rename and Refactor this service
* This service is being used in both CipherForm and CipherView. Update this service to reflect that
*/
/**
* Service to capture TOTP secret from a client application.
*/
@@ -11,5 +6,4 @@ export abstract class TotpCaptureService {
* Captures a TOTP secret and returns it as a string. Returns null if no TOTP secret was found.
*/
abstract captureTotpSecret(): Promise<string | null>;
abstract openAutofillNewTab(loginUri: string): void;
}

View File

@@ -2,18 +2,17 @@ import { CommonModule } from "@angular/common";
import { Component, Input } from "@angular/core";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view";
import {
CardComponent,
FormFieldModule,
IconButtonModule,
SectionComponent,
SectionHeaderComponent,
TypographyModule,
IconButtonModule,
} from "@bitwarden/components";
import { TotpCaptureService } from "../../cipher-form";
@Component({
selector: "app-autofill-options-view",
templateUrl: "autofill-options-view.component.html",
@@ -32,9 +31,9 @@ import { TotpCaptureService } from "../../cipher-form";
export class AutofillOptionsViewComponent {
@Input() loginUris: LoginUriView[];
constructor(private totpCaptureService: TotpCaptureService) {}
constructor(private platformUtilsService: PlatformUtilsService) {}
async openWebsite(selectedUri: string) {
await this.totpCaptureService.openAutofillNewTab(selectedUri);
openWebsite(selectedUri: string) {
this.platformUtilsService.launchUri(selectedUri);
}
}