From 815f379c2444967de71c1eba82f2ad385ff3bab3 Mon Sep 17 00:00:00 2001 From: Patrick Pimentel Date: Wed, 11 Jun 2025 21:56:23 -0600 Subject: [PATCH] feat(change-password-component): Change Password Update [18720] - Removed unneeded code. --- libs/auth/src/angular/login/login.component.ts | 13 +------------ .../login-strategies/password-login.strategy.ts | 9 ++------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index 188393088e7..4526fc4d95c 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -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 diff --git a/libs/auth/src/common/login-strategies/password-login.strategy.ts b/libs/auth/src/common/login-strategies/password-login.strategy.ts index 1934bf35ebc..8734970ba70 100644 --- a/libs/auth/src/common/login-strategies/password-login.strategy.ts +++ b/libs/auth/src/common/login-strategies/password-login.strategy.ts @@ -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);