diff --git a/apps/web/src/app/auth/core/services/webauthn/response/webauthn-credential.response.ts b/apps/web/src/app/auth/core/services/webauthn/response/webauthn-credential.response.ts index 32459d5e2d..81f390096c 100644 --- a/apps/web/src/app/auth/core/services/webauthn/response/webauthn-credential.response.ts +++ b/apps/web/src/app/auth/core/services/webauthn/response/webauthn-credential.response.ts @@ -3,12 +3,12 @@ import { BaseResponse } from "@bitwarden/common/models/response/base.response"; export class WebauthnCredentialResponse extends BaseResponse { id: string; name: string; - prf: "active" | "inactive" | "unsupported"; + prfSupport: boolean; constructor(response: unknown) { super(response); this.id = this.getResponseProperty("id"); this.name = this.getResponseProperty("name"); - this.prf = this.getResponseProperty("prf"); + this.prfSupport = this.getResponseProperty("prfSupport"); } } diff --git a/apps/web/src/app/auth/core/views/webauth-credential.view.ts b/apps/web/src/app/auth/core/views/webauth-credential.view.ts index c89546070f..ff5a9c692d 100644 --- a/apps/web/src/app/auth/core/views/webauth-credential.view.ts +++ b/apps/web/src/app/auth/core/views/webauth-credential.view.ts @@ -1,5 +1,5 @@ export class WebauthnCredentialView { id: string; name: string; - prf: "active" | "inactive" | "unsupported"; + prfSupport: boolean; } diff --git a/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.html b/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.html index 866e67c5bf..3036e4b07b 100644 --- a/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.html +++ b/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.html @@ -1,21 +1,53 @@

- {{ "loginWithPasskey" | i18n }} Not implemented - + {{ "loginWithPasskey" | i18n }} + + {{ "on" | i18n }} + {{ "off" | i18n }} + + + +

{{ "loginWithPasskeyInfo" | i18n }} {{ "learnMoreAboutPasswordless" | i18n }}

- + + + + + + +
{{ credential.name }} + + + {{ "supportsEncryption" | i18n }} + + - + + +
- + + + + + diff --git a/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.ts b/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.ts index fd10a46203..622576bbc1 100644 --- a/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.ts +++ b/apps/web/src/app/auth/settings/fido2-login-settings/fido2-login-settings.component.ts @@ -1,5 +1,5 @@ import { Component, HostBinding, OnDestroy, OnInit } from "@angular/core"; -import { Observable, Subject, takeUntil } from "rxjs"; +import { Subject, takeUntil } from "rxjs"; import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog"; @@ -18,7 +18,7 @@ import { openCreateCredentialDialog } from "./create-credential-dialog/create-cr export class Fido2LoginSettingsComponent implements OnInit, OnDestroy { private destroy$ = new Subject(); - protected credentials$: Observable; + protected credentials?: WebauthnCredentialView[]; protected loading = true; constructor( @@ -31,8 +31,18 @@ export class Fido2LoginSettingsComponent implements OnInit, OnDestroy { return this.loading ? "true" : "false"; } + get hasCredentials() { + return this.credentials && this.credentials.length > 0; + } + + get hasData() { + return this.credentials !== undefined; + } + ngOnInit(): void { - this.credentials$ = this.webauthnService.credentials$; + this.webauthnService.credentials$ + .pipe(takeUntil(this.destroy$)) + .subscribe((credentials) => (this.credentials = credentials)); this.webauthnService.loading$ .pipe(takeUntil(this.destroy$)) diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index b3b02399c5..5b09ca8500 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -664,6 +664,9 @@ "customPasskeyNameInfo": { "message": "Name your passkey to help you identify it." }, + "supportsEncryption": { + "message": "supports encryption" + }, "tryAgain": { "message": "Try again" }, @@ -5759,6 +5762,9 @@ "on": { "message": "On" }, + "off": { + "message": "Off" + }, "members": { "message": "Members" },