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

feat(change-password-component): Change Password Update [18720] - Removed unneeded code.

This commit is contained in:
Patrick Pimentel
2025-06-11 21:56:23 -06:00
parent ef6dc1b80b
commit 815f379c24
2 changed files with 3 additions and 19 deletions

View File

@@ -84,8 +84,6 @@ export class LoginComponent implements OnInit, OnDestroy {
isKnownDevice = false;
loginUiState: LoginUiState = LoginUiState.EMAIL_ENTRY;
passwordPoliciesFromOrgInvite?: Policy[];
formGroup = this.formBuilder.group(
{
email: ["", [Validators.required, Validators.email]],
@@ -244,10 +242,6 @@ export class LoginComponent implements OnInit, OnDestroy {
const orgMasterPasswordPolicyOptions = orgPoliciesFromInvite?.enforcedPasswordPolicyOptions;
// Grab the org policies from invite so that it can be evaluated after we have logged in and
// received a user id.
this.passwordPoliciesFromOrgInvite = orgPoliciesFromInvite?.policies;
credentials = new PasswordLoginCredentials(
email,
masterPassword,
@@ -339,13 +333,8 @@ export class LoginComponent implements OnInit, OnDestroy {
// The AuthGuard will handle routing to update-temp-password based on state
if (
await this.configService.getFeatureFlag(FeatureFlag.PM16117_ChangeExistingPasswordRefactor)
!(await this.configService.getFeatureFlag(FeatureFlag.PM16117_ChangeExistingPasswordRefactor))
) {
// Check if we have policies to set from an org invite scenario.
if (this.passwordPoliciesFromOrgInvite) {
await this.setPoliciesIntoState(authResult.userId, this.passwordPoliciesFromOrgInvite);
}
} else {
// TODO: PM-18269 - evaluate if we can combine this with the
// password evaluation done in the password login strategy.
// If there's an existing org invite, use it to get the org's password policies

View File

@@ -100,12 +100,6 @@ export class PasswordLoginStrategy extends LoginStrategy {
await this.buildDeviceRequest(),
);
if (
await this.configService.getFeatureFlag(FeatureFlag.PM16117_ChangeExistingPasswordRefactor)
) {
data.passwordPolicy = credentials.masterPasswordPoliciesFromOrgInvite;
}
this.cache.next(data);
const [authResult, identityResponse] = await this.startLogIn();
@@ -181,7 +175,8 @@ export class PasswordLoginStrategy extends LoginStrategy {
if (
await this.configService.getFeatureFlag(FeatureFlag.PM16117_ChangeExistingPasswordRefactor)
) {
// !IMPORTANT! Take credentials from a potential org invite first, then take from
// Either take credentials from a potential org invite first, then take from
// the identity response if that doesn't exist.
masterPasswordPolicyOptions = credentials.masterPasswordPoliciesFromOrgInvite
? credentials.masterPasswordPoliciesFromOrgInvite
: this.getMasterPasswordPolicyOptionsFromResponse(identityResponse);