1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 13:40:06 +00:00

setup PasswordSettingsComponent and ChangeExistingPasswordComponent

This commit is contained in:
rr-bw
2025-03-19 13:07:56 -07:00
parent b66430b25c
commit 7eddf8b55a
7 changed files with 87 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
<auth-input-password
[inputPasswordFlow]="
InputPasswordFlow.ChangeExistingPasswordAndOptionallyRotateAccountEncryptionKey
"
[email]="email"
[masterPasswordPolicyOptions]="masterPasswordPolicyOptions"
[inlineButtons]="true"
[primaryButtonText]="{ key: 'changeMasterPassword' }"
>
</auth-input-password>

View File

@@ -0,0 +1,39 @@
import { Component, OnInit } from "@angular/core";
import { firstValueFrom, map } from "rxjs";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import {
InputPasswordComponent,
InputPasswordFlow,
} from "../input-password/input-password.component";
@Component({
standalone: true,
selector: "auth-change-existing-password",
templateUrl: "change-existing-password.component.html",
imports: [InputPasswordComponent],
})
export class ChangeExistingPasswordComponent implements OnInit {
protected InputPasswordFlow = InputPasswordFlow;
protected email?: string;
protected masterPasswordPolicyOptions?: MasterPasswordPolicyOptions;
constructor(
private accountService: AccountService,
private policyService: PolicyService,
) {}
async ngOnInit() {
this.email = await firstValueFrom(
this.accountService.activeAccount$.pipe(map((a) => a?.email)),
);
this.masterPasswordPolicyOptions = await firstValueFrom(
this.policyService.masterPasswordPolicyOptions$(),
);
}
}

View File

@@ -8,6 +8,9 @@ export * from "./anon-layout/anon-layout-wrapper.component";
export * from "./anon-layout/anon-layout-wrapper-data.service";
export * from "./anon-layout/default-anon-layout-wrapper-data.service";
// change existing password
export * from "./change-existing-password/change-existing-password.component";
// fingerprint dialog
export * from "./fingerprint-dialog/fingerprint-dialog.component";