1
0
mirror of https://github.com/bitwarden/web synced 2026-01-04 17:43:47 +00:00

[Reset Password v1] Make auto enrollment required when enabled (#1047)

This commit is contained in:
Vincent Salucci
2021-07-09 13:24:59 -05:00
committed by GitHub
parent 41ad5aa26d
commit cc2b717d6b
2 changed files with 6 additions and 3 deletions

View File

@@ -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;