1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-14 01:01:31 +01:00

[PM-2014] feat: show toast on passkey saved

This commit is contained in:
Andreas Coroiu 2023-05-10 13:21:09 +02:00
parent 2e5f9e58d3
commit 355a52f43f
No known key found for this signature in database
GPG Key ID: E70B5FFC81DFEC1A
3 changed files with 15 additions and 0 deletions

View File

@ -100,6 +100,7 @@ describe("WebauthnService", () => {
expect(result).toBe(true); expect(result).toBe(true);
expect(apiService.saveCredential).toHaveBeenCalled(); expect(apiService.saveCredential).toHaveBeenCalled();
expect(platformUtilsService.showToast).toHaveBeenCalled();
}); });
}); });
}); });

View File

@ -91,6 +91,11 @@ export class WebauthnService {
request.token = credentialOptions.token; request.token = credentialOptions.token;
request.name = name; request.name = name;
await this.apiService.saveCredential(request); await this.apiService.saveCredential(request);
this.platformUtilsService.showToast(
"success",
null,
this.i18nService.t("passkeySaved", name)
);
this.refresh(); this.refresh();
return true; return true;
} catch (error) { } catch (error) {

View File

@ -664,6 +664,15 @@
"supportsEncryption": { "supportsEncryption": {
"message": "supports encryption" "message": "supports encryption"
}, },
"passkeySaved": {
"message": "$NAME$ saved",
"placeholders": {
"name": {
"content": "$1",
"example": "Personal yubikey"
}
}
},
"tryAgain": { "tryAgain": {
"message": "Try again" "message": "Try again"
}, },