From cc2b717d6bbf6d02acb8197fd864d831e7024870 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Fri, 9 Jul 2021 13:24:59 -0500 Subject: [PATCH] [Reset Password v1] Make auto enrollment required when enabled (#1047) --- src/app/settings/organizations.component.ts | 5 ++++- src/locales/en/messages.json | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/settings/organizations.component.ts b/src/app/settings/organizations.component.ts index 62e4d7e411..78a47befe8 100644 --- a/src/app/settings/organizations.component.ts +++ b/src/app/settings/organizations.component.ts @@ -57,7 +57,10 @@ export class OrganizationsComponent implements OnInit { allowEnrollmentChanges(org: Organization): boolean { if (org.usePolicies && org.useResetPassword && org.hasPublicAndPrivateKeys) { - return this.policies.some(p => p.organizationId === org.id && p.enabled); + const policy = this.policies.find(p => p.organizationId === org.id); + if (policy != null && policy.enabled) { + return org.resetPasswordEnrolled && policy.data.autoEnrollEnabled ? false : true; + } } return false; diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 1a9da41616..d502ea9393 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -3947,13 +3947,13 @@ "message": "Automatic Enrollment" }, "resetPasswordPolicyAutoEnrollDescription": { - "message": "All users will be automatically enrolled in password reset once their invite is accepted." + "message": "All users will be automatically enrolled in password reset once their invite is accepted and will not be allowed to withdraw." }, "resetPasswordPolicyAutoEnrollWarning": { "message": "Users already in the organization will not be retroactively enrolled in password reset. They will need to self-enroll before administrators can reset their master password." }, "resetPasswordPolicyAutoEnrollCheckbox": { - "message": "Automatically enroll new users" + "message": "Require new users to be enrolled automatically" }, "resetPasswordAutoEnrollInviteWarning": { "message": "This organization has an enterprise policy that will automatically enroll you in password reset. Enrollment will allow organization administrators to change your master password."