1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

[EC-598] feat: inform user when no credentials are found

This commit is contained in:
Andreas Coroiu
2023-04-17 11:20:25 +02:00
parent 1ab263e4d9
commit 69e36b972b
5 changed files with 43 additions and 9 deletions

View File

@@ -46,6 +46,14 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="data.type == 'InformCredentialNotFoundRequest'">
You do not have a matching login for this site.
<div class="box list">
<div class="box-content">
<app-cipher-row *ngFor="let cipher of ciphers" [cipher]="cipher"></app-cipher-row>
</div>
</div>
</ng-container>
<button type="button" class="btn btn-outline-secondary" (click)="abort(true)">
Use browser built-in
</button>

View File

@@ -10,13 +10,13 @@ import {
takeUntil,
} from "rxjs";
import { Utils } from "@bitwarden/common/misc/utils";
import { UserRequestedFallbackAbortReason } from "@bitwarden/common/fido2/abstractions/fido2-client.service.abstraction";
import {
Fido2UserInterfaceService as Fido2UserInterfaceServiceAbstraction,
Fido2UserInterfaceSession,
NewCredentialParams,
} from "@bitwarden/common/fido2/abstractions/fido2-user-interface.service.abstraction";
import { Utils } from "@bitwarden/common/misc/utils";
import { BrowserApi } from "../../browser/browserApi";
import { PopupUtilsService } from "../../popup/services/popup-utils.service";
@@ -79,6 +79,9 @@ export type BrowserFido2Message = { sessionId: string } & (
type: "InformExcludedCredentialRequest";
existingCipherIds: string[];
}
| {
type: "InformCredentialNotFoundRequest";
}
| {
type: "AbortRequest";
}
@@ -240,6 +243,16 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi
await this.receive("AbortResponse");
}
async informCredentialNotFound(): Promise<void> {
const data: BrowserFido2Message = {
type: "InformCredentialNotFoundRequest",
sessionId: this.sessionId,
};
await this.send(data);
await this.receive("AbortResponse");
}
async close() {
await this.send({ type: "CloseRequest", sessionId: this.sessionId });
this.closed = true;