1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 04:03:29 +00:00

Extra user verification step

This commit is contained in:
Katherine Reynolds
2025-11-12 12:37:08 -08:00
parent 74aa3534a5
commit 90e5092b4a
2 changed files with 27 additions and 0 deletions

View File

@@ -4757,6 +4757,9 @@
"demoSettings": {
"message": "Demo settings"
},
"credentialsWillBeSentToTunnel": {
"message": "For demo use only. Credentials will be sent over secure tunnel."
},
"demoRetrieve": {
"message": "Fetch"
},

View File

@@ -4,6 +4,7 @@ import { FormBuilder, ReactiveFormsModule, Validators } from "@angular/forms";
import { firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { UserVerificationDialogComponent } from "@bitwarden/auth/angular";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
@@ -99,6 +100,29 @@ export class TunnelDemoComponent {
const username = tunnelDemoCipher.login.username || "(none)";
const password = tunnelDemoCipher.login.password || "(none)";
// Verify user identity before sending credentials
const verificationResult = await UserVerificationDialogComponent.open(this.dialogService, {
verificationType: "client",
title: "verificationRequired",
bodyText: "verifyIdentityToSendCredentials",
calloutOptions: {
text: "credentialsWillBeSentToTunnel",
type: "warning",
},
});
// Check if user cancelled or verification failed
if (verificationResult.userAction === "cancel" || !verificationResult.verificationSuccess) {
await this.dialogService.openSimpleDialog({
title: "Tunnel Demo - Cancelled",
content: "User verification was cancelled or failed.",
type: "info",
acceptButtonText: { key: "ok" },
cancelButtonText: null,
});
return;
}
// Send credentials to the localhost tunnel server
try {
await this.tunnelService.sendCredentials({ username, password });