mirror of
https://github.com/bitwarden/browser
synced 2026-02-09 05:00:10 +00:00
feat(change-password-component): Change Password Update [18720] - Undid naming change.
This commit is contained in:
@@ -536,7 +536,7 @@ export class LoginCommand {
|
||||
);
|
||||
|
||||
const enforcedPolicyOptions = await firstValueFrom(
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(userId),
|
||||
this.policyService.masterPasswordPolicyOptions$(userId),
|
||||
);
|
||||
|
||||
// Verify master password meets policy requirements
|
||||
|
||||
@@ -98,7 +98,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
|
||||
this.accountService.activeAccount$
|
||||
.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptionsFromSync$(userId)),
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(
|
||||
|
||||
@@ -134,7 +134,7 @@ describe("WebLoginComponentService", () => {
|
||||
resetPasswordPolicyEnabled,
|
||||
]);
|
||||
|
||||
internalPolicyService.masterPasswordPolicyOptionsFromSync$.mockReturnValue(
|
||||
internalPolicyService.masterPasswordPolicyOptions$.mockReturnValue(
|
||||
of(masterPasswordPolicyOptions),
|
||||
);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ export class WebLoginComponentService
|
||||
this.accountService.activeAccount$.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies),
|
||||
this.policyService.masterPasswordPolicyOptions$(userId, policies),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -149,9 +149,7 @@ describe("WebRegistrationFinishService", () => {
|
||||
|
||||
acceptOrgInviteService.getOrganizationInvite.mockResolvedValue(orgInvite);
|
||||
policyApiService.getPoliciesByToken.mockResolvedValue(masterPasswordPolicies);
|
||||
policyService.masterPasswordPolicyOptionsFromSync$.mockReturnValue(
|
||||
of(masterPasswordPolicyOptions),
|
||||
);
|
||||
policyService.masterPasswordPolicyOptions$.mockReturnValue(of(masterPasswordPolicyOptions));
|
||||
|
||||
const result = await service.getMasterPasswordPolicyOptsFromOrgInvite();
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ export class WebRegistrationFinishService
|
||||
}
|
||||
|
||||
const masterPasswordPolicyOpts: MasterPasswordPolicyOptions = await firstValueFrom(
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(null, policies),
|
||||
this.policyService.masterPasswordPolicyOptions$(null, policies),
|
||||
);
|
||||
|
||||
return masterPasswordPolicyOpts;
|
||||
|
||||
@@ -91,9 +91,7 @@ export class EmergencyAccessTakeoverComponent
|
||||
this.accountService.activeAccount$
|
||||
.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies),
|
||||
),
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId, policies)),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe((enforcedPolicyOptions) => (this.enforcedPolicyOptions = enforcedPolicyOptions));
|
||||
|
||||
@@ -191,9 +191,7 @@ export class CompleteTrialInitiationComponent implements OnInit, OnDestroy {
|
||||
this.accountService.activeAccount$
|
||||
.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(userId, policies),
|
||||
),
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId, policies)),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe((enforcedPasswordPolicyOptions) => {
|
||||
|
||||
@@ -56,7 +56,7 @@ export class ChangePasswordComponent implements OnInit, OnDestroy {
|
||||
this.accountService.activeAccount$
|
||||
.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptionsFromSync$(userId)),
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(
|
||||
|
||||
@@ -45,7 +45,7 @@ export abstract class PolicyService {
|
||||
* @returns a set of options which represent the minimum Master Password settings that the user must
|
||||
* comply with in order to comply with **all** applicable Master Password policies.
|
||||
*/
|
||||
abstract masterPasswordPolicyOptionsFromSync$: (
|
||||
abstract masterPasswordPolicyOptions$: (
|
||||
userId: UserId,
|
||||
policies?: Policy[],
|
||||
) => Observable<MasterPasswordPolicyOptions | undefined>;
|
||||
|
||||
@@ -127,9 +127,7 @@ describe("PolicyService", () => {
|
||||
];
|
||||
jest.spyOn(policyService as any, "policies$").mockReturnValue(of(model));
|
||||
|
||||
const result = await firstValueFrom(
|
||||
policyService.masterPasswordPolicyOptionsFromSync$(userId),
|
||||
);
|
||||
const result = await firstValueFrom(policyService.masterPasswordPolicyOptions$(userId));
|
||||
|
||||
expect(result).toEqual({
|
||||
minComplexity: 5,
|
||||
@@ -154,9 +152,7 @@ describe("PolicyService", () => {
|
||||
];
|
||||
jest.spyOn(policyService as any, "policies$").mockReturnValue(of(model));
|
||||
|
||||
const result = await firstValueFrom(
|
||||
policyService.masterPasswordPolicyOptionsFromSync$(userId),
|
||||
);
|
||||
const result = await firstValueFrom(policyService.masterPasswordPolicyOptions$(userId));
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
@@ -173,9 +169,7 @@ describe("PolicyService", () => {
|
||||
];
|
||||
jest.spyOn(policyService as any, "policies$").mockReturnValue(of(model));
|
||||
|
||||
const result = await firstValueFrom(
|
||||
policyService.masterPasswordPolicyOptionsFromSync$(userId),
|
||||
);
|
||||
const result = await firstValueFrom(policyService.masterPasswordPolicyOptions$(userId));
|
||||
|
||||
expect(result).toEqual({
|
||||
minComplexity: 0,
|
||||
|
||||
@@ -82,7 +82,7 @@ export class DefaultPolicyService implements PolicyService {
|
||||
});
|
||||
}
|
||||
|
||||
masterPasswordPolicyOptionsFromSync$(
|
||||
masterPasswordPolicyOptions$(
|
||||
userId: UserId,
|
||||
policies?: Policy[],
|
||||
): Observable<MasterPasswordPolicyOptions | undefined> {
|
||||
|
||||
@@ -107,7 +107,7 @@ export class PolicyApiService implements PolicyApiServiceAbstraction {
|
||||
this.accountService.activeAccount$.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(userId, [masterPasswordPolicy]),
|
||||
this.policyService.masterPasswordPolicyOptions$(userId, [masterPasswordPolicy]),
|
||||
),
|
||||
map((policy) => policy ?? null),
|
||||
),
|
||||
|
||||
@@ -603,9 +603,7 @@ export class LockComponent implements OnInit, OnDestroy {
|
||||
this.enforcedMasterPasswordOptions = await firstValueFrom(
|
||||
this.accountService.activeAccount$.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.policyService.masterPasswordPolicyOptionsFromSync$(userId),
|
||||
),
|
||||
switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user