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

add dynamic anon-layout wrapper data

This commit is contained in:
rr-bw
2024-09-12 11:39:43 -07:00
parent 8696330245
commit 6ffaeae331
4 changed files with 33 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ import {
ToastService,
} from "@bitwarden/components";
import { AnonLayoutWrapperDataService } from "../anon-layout/anon-layout-wrapper-data.service";
import { WaveIcon } from "../icons";
import { LoginService } from "./login.service";
const BroadcasterSubscriptionId = "LoginComponent";
@@ -68,6 +71,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
@Input() captchaSiteKey: string = null;
private destroy$ = new Subject<void>();
readonly Icons = { WaveIcon };
captcha: CaptchaIFrame;
captchaToken: string = null;
@@ -79,7 +83,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
validatedEmail = false;
formGroup = this.formBuilder.group({
email: ["", { validators: [Validators.required, Validators.email], updateOn: "submit" }],
email: ["", [Validators.required, Validators.email]],
masterPassword: [
"",
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
@@ -111,6 +115,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
constructor(
private activatedRoute: ActivatedRoute,
private anonLayoutWrapperDataService: AnonLayoutWrapperDataService,
private appIdService: AppIdService,
private broadcasterService: BroadcasterService,
private devicesApiService: DevicesApiServiceAbstraction,
@@ -330,6 +335,16 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
if (emailValid) {
this.toggleValidateEmail(true);
await this.getLoginWithDevice(this.loggedEmail);
this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({
pageTitle: "welcomeBack",
pageSubtitle: {
// TODO-rr-bw: add an icon that takes the user back
subtitle: `(todo: back btn) ${this.loggedEmail}`,
translate: false,
},
pageIcon: this.Icons.WaveIcon,
});
}
}