diff --git a/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.spec.ts b/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.spec.ts index ecbc45dbe02f..9480652b669e 100644 --- a/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.spec.ts +++ b/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.spec.ts @@ -791,6 +791,33 @@ describe("MemberActionsService", () => { expect(result).toBe(false); }); + it("should allow reset password when user status is accepted and AdminResetTwoFactor is enabled", () => { + const user = { + ...mockOrgUser, + status: OrganizationUserStatusType.Accepted, + } as OrganizationUserView; + + const result = service.allowResetPassword(user, mockOrganization, resetPasswordEnabled, true); + + expect(result).toBe(true); + }); + + it("should not allow reset password when user status is accepted and AdminResetTwoFactor is disabled", () => { + const user = { + ...mockOrgUser, + status: OrganizationUserStatusType.Accepted, + } as OrganizationUserView; + + const result = service.allowResetPassword( + user, + mockOrganization, + resetPasswordEnabled, + false, + ); + + expect(result).toBe(false); + }); + it("should not allow reset password when user status is invited", () => { const user = { ...mockOrgUser, diff --git a/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.ts b/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.ts index f69b84be3ef7..bd0b7317dc38 100644 --- a/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.ts +++ b/apps/web/src/app/admin-console/organizations/members/services/member-actions/member-actions.service.ts @@ -235,7 +235,8 @@ export class MemberActionsService { const statusAllowed = orgUser.status === OrganizationUserStatusType.Confirmed || - (adminResetTwoFactorEnabled && orgUser.status === OrganizationUserStatusType.Revoked); + (adminResetTwoFactorEnabled && orgUser.status === OrganizationUserStatusType.Revoked) || + (adminResetTwoFactorEnabled && orgUser.status === OrganizationUserStatusType.Accepted); return ( organization.canManageUsersPassword &&