1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00
Files
browser/libs/vault/src/cipher-form/abstractions/totp-capture.service.ts
Jordan Aasen ddc817689a [PM-13365] - don't display totp capture when in popout (#12645)
* don't display totp capture when in popout

* add canCaptureTotp method

* dry up logic

* add unit tests

* fix failing tests

* add missing mock to cipher-form story
2025-01-06 13:52:42 -08:00

15 lines
497 B
TypeScript

/**
* Service to capture TOTP secret from a client application.
*/
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>;
/**
* Returns whether the TOTP secret can be captured from the current tab.
* Only available in the browser extension and when not in a popout window.
*/
abstract canCaptureTotp(window: Window): boolean;
}