Browse Source

check if reset policy is enabled

pull/3427/head
Stefan Melmuk 2 years ago
parent
commit
89e94b1d91
No known key found for this signature in database GPG Key ID: 817020C608FE9C09
  1. 2
      src/db/models/org_policy.rs

2
src/db/models/org_policy.rs

@ -309,7 +309,7 @@ impl OrgPolicy {
match OrgPolicy::find_by_org_and_type(org_uuid, OrgPolicyType::ResetPassword, conn).await {
Some(policy) => match serde_json::from_str::<UpCase<ResetPasswordDataModel>>(&policy.data) {
Ok(opts) => {
return opts.data.AutoEnrollEnabled;
return policy.enabled && opts.data.AutoEnrollEnabled;
}
_ => error!("Failed to deserialize ResetPasswordDataModel: {}", policy.data),
},

Loading…
Cancel
Save