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:
@@ -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" },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,9 @@ export class SendViewComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.layoutWrapperDataService.setAnonLayoutWrapperData({
|
||||
pageTitle: { key: "sendAccessContentTitle" },
|
||||
});
|
||||
void this.load();
|
||||
}
|
||||
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user