1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 03:33:30 +00:00

[PM-2014] feat: add passkey limit

This commit is contained in:
Andreas Coroiu
2023-05-11 13:48:45 +02:00
parent 46ed70bd7a
commit f8f7615f6c
3 changed files with 12 additions and 1 deletions

View File

@@ -37,7 +37,9 @@
</tr>
</table>
<ng-container *ngIf="hasData">
<p bitTypography="body2" *ngIf="limitReached">{{ "passkeyLimitReachedInfo" | i18n }}</p>
<ng-container *ngIf="hasData && !limitReached">
<button
*ngIf="hasCredentials"
type="button"

View File

@@ -19,6 +19,8 @@ import { openDeleteCredentialDialogComponent } from "./delete-credential-dialog/
export class Fido2LoginSettingsComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
protected readonly MaxCredentialCount = 5;
protected credentials?: WebauthnCredentialView[];
protected loading = true;
@@ -40,6 +42,10 @@ export class Fido2LoginSettingsComponent implements OnInit, OnDestroy {
return this.credentials !== undefined;
}
get limitReached() {
return this.credentials?.length >= this.MaxCredentialCount;
}
ngOnInit(): void {
this.webauthnService.credentials$
.pipe(takeUntil(this.destroy$))

View File

@@ -682,6 +682,9 @@
"removePasskeyInfo": {
"message": "If all passkeys are removed, you will be unable to log into new devices without your master password."
},
"passkeyLimitReachedInfo": {
"message": "Passkey limit reached. Remove a passkey to add another."
},
"tryAgain": {
"message": "Try again"
},