diff --git a/apps/browser/src/platform/browser/browser-api.ts b/apps/browser/src/platform/browser/browser-api.ts index e8070f0d34..dce72f5cf6 100644 --- a/apps/browser/src/platform/browser/browser-api.ts +++ b/apps/browser/src/platform/browser/browser-api.ts @@ -235,6 +235,27 @@ export class BrowserApi { } } + static messageListener$() { + return new Observable((subscriber) => { + const handler = (message: unknown) => { + subscriber.next(message); + }; + + BrowserApi.messageListener("message", handler); + + return () => { + chrome.runtime.onMessage.removeListener(handler); + + if (BrowserApi.isSafariApi) { + const index = BrowserApi.registeredMessageListeners.indexOf(handler); + if (index !== -1) { + BrowserApi.registeredMessageListeners.splice(index, 1); + } + } + }; + }); + } + static storageChangeListener( callback: Parameters[0] ) { @@ -262,27 +283,6 @@ export class BrowserApi { }; } - static messageListener$() { - return new Observable((subscriber) => { - const handler = (message: unknown) => { - subscriber.next(message); - }; - - BrowserApi.messageListener("message", handler); - - return () => { - chrome.runtime.onMessage.removeListener(handler); - - if (BrowserApi.isSafariApi) { - const index = BrowserApi.registeredMessageListeners.indexOf(handler); - if (index !== -1) { - BrowserApi.registeredMessageListeners.splice(index, 1); - } - } - }; - }); - } - static sendMessage(subscriber: string, arg: any = {}) { const message = Object.assign({}, { command: subscriber }, arg); return chrome.runtime.sendMessage(message); diff --git a/apps/browser/src/vault/popup/components/fido2/fido2-cipher-row.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2-cipher-row.component.ts index 21ff136bf4..c07d2ef886 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2-cipher-row.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2-cipher-row.component.ts @@ -14,7 +14,7 @@ export class Fido2CipherRowComponent { @Input() isSearching: boolean; @Input() isSelected: boolean; - selectCipher(c: CipherView) { + protected selectCipher(c: CipherView) { this.onSelected.emit(c); } } diff --git a/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts index 712f728c32..aaebb225b8 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts @@ -11,9 +11,9 @@ import { templateUrl: "fido2-use-browser-link.component.html", }) export class Fido2UseBrowserLinkComponent { - fido2PopoutSessionData$ = fido2PopoutSessionData$(); + protected fido2PopoutSessionData$ = fido2PopoutSessionData$(); - async abort() { + protected async abort() { const sessionData = await firstValueFrom(this.fido2PopoutSessionData$); BrowserFido2UserInterfaceSession.abortPopout(sessionData.sessionId, true); return; diff --git a/apps/browser/src/vault/popup/components/fido2/fido2.component.html b/apps/browser/src/vault/popup/components/fido2/fido2.component.html index 0f298b67fb..7233fa7636 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2.component.html +++ b/apps/browser/src/vault/popup/components/fido2/fido2.component.html @@ -7,13 +7,13 @@ - + - + - +

{{ "passkeyAlreadyExists" | i18n }}

@@ -120,7 +120,7 @@
- +

{{ "noPasskeysFoundForThisApplication" | i18n }}

diff --git a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts index ed0ddbd144..03ae926859 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts @@ -217,7 +217,7 @@ export class Fido2Component implements OnInit, OnDestroy { }); } - async submit() { + protected async submit() { const data = this.message$.value; if (data?.type === "PickCredentialRequest") { const userVerified = await this.handleUserVerification(data.userVerification, this.cipher); @@ -254,7 +254,7 @@ export class Fido2Component implements OnInit, OnDestroy { this.loading = true; } - async saveNewLogin() { + protected async saveNewLogin() { const data = this.message$.value; if (data?.type === "ConfirmNewCredentialRequest") { let userVerified = false; diff --git a/apps/browser/src/vault/popup/components/vault/add-edit.component.ts b/apps/browser/src/vault/popup/components/vault/add-edit.component.ts index ded14ec92e..971f3bee5b 100644 --- a/apps/browser/src/vault/popup/components/vault/add-edit.component.ts +++ b/apps/browser/src/vault/popup/components/vault/add-edit.component.ts @@ -168,13 +168,12 @@ export class AddEditComponent extends BaseAddEditComponent { async submit(): Promise { const fido2SessionData = await firstValueFrom(this.fido2PopoutSessionData$); // Would be refactored after rework is done on the windows popout service + + const { isFido2Session, sessionId, userVerification } = fido2SessionData; if ( this.inPopout && - fido2SessionData.isFido2Session && - !(await this.handleFido2UserVerification( - fido2SessionData.sessionId, - fido2SessionData.userVerification - )) + isFido2Session && + !(await this.handleFido2UserVerification(sessionId, userVerification)) ) { return false; } @@ -184,11 +183,11 @@ export class AddEditComponent extends BaseAddEditComponent { return false; } - if (this.inPopout && fido2SessionData.isFido2Session) { + if (this.inPopout && isFido2Session) { BrowserFido2UserInterfaceSession.confirmNewCredentialResponse( - fido2SessionData.sessionId, + sessionId, this.cipher.id, - fido2SessionData.userVerification + userVerification ); return true; }