1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-18 02:19:18 +00:00

add dynamic EV headers (#18949)

This commit is contained in:
John Harrington
2026-02-13 14:14:31 -07:00
committed by GitHub
parent bd9734c14c
commit f5b1be7e62
3 changed files with 29 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ import { SendAccessResponse } from "@bitwarden/common/tools/send/models/response
import { SEND_KDF_ITERATIONS } from "@bitwarden/common/tools/send/send-kdf";
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
import { AuthType } from "@bitwarden/common/tools/send/types/auth-type";
import { ToastService } from "@bitwarden/components";
import { AnonLayoutWrapperDataService, ToastService } from "@bitwarden/components";
import { SharedModule } from "../../../shared";
@@ -69,9 +69,11 @@ export class SendAuthComponent implements OnInit {
private formBuilder: FormBuilder,
private configService: ConfigService,
private sendTokenService: SendTokenService,
private anonLayoutWrapperDataService: AnonLayoutWrapperDataService,
) {}
ngOnInit() {
this.updatePageTitle();
void this.onSubmit();
}
@@ -160,8 +162,10 @@ export class SendAuthComponent implements OnInit {
this.expiredAuthAttempts = 0;
if (emailRequired(response.error)) {
this.sendAuthType.set(AuthType.Email);
this.updatePageTitle();
} else if (emailAndOtpRequired(response.error)) {
this.enterOtp.set(true);
this.updatePageTitle();
} else if (otpInvalid(response.error)) {
this.toastService.showToast({
variant: "error",
@@ -170,6 +174,7 @@ export class SendAuthComponent implements OnInit {
});
} else if (passwordHashB64Required(response.error)) {
this.sendAuthType.set(AuthType.Password);
this.updatePageTitle();
} else if (passwordHashB64Invalid(response.error)) {
this.toastService.showToast({
variant: "error",
@@ -207,4 +212,20 @@ export class SendAuthComponent implements OnInit {
);
return Utils.fromBufferToB64(passwordHash) as SendHashedPasswordB64;
}
private updatePageTitle(): void {
const authType = this.sendAuthType();
if (authType === AuthType.Email) {
if (this.enterOtp()) {
this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({
pageTitle: { key: "enterTheCodeSentToYourEmail" },
});
} else {
this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({
pageTitle: { key: "verifyYourEmailToViewThisSend" },
});
}
}
}
}

View File

@@ -69,6 +69,9 @@ export class SendViewComponent implements OnInit {
) {}
ngOnInit() {
this.layoutWrapperDataService.setAnonLayoutWrapperData({
pageTitle: { key: "sendAccessContentTitle" },
});
void this.load();
}

View File

@@ -6438,6 +6438,10 @@
"message": "View Send",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
},
"verifyYourEmailToViewThisSend": {
"message": "Verify your email to view this Send",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
},
"viewSendHiddenEmailWarning": {
"message": "The Bitwarden user who created this Send has chosen to hide their email address. You should ensure you trust the source of this link before using or downloading its content.",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."