commit 89e94b1d91828f94d41ad3d4b02c734da7706ff2
parent 0b28ab3be101b58cf27b43da14bcf893fa37c1c8
Author: Stefan Melmuk <stefan.melmuk@gmail.com>
Date: Thu, 6 Apr 2023 22:34:05 +0200
check if reset policy is enabled
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/db/models/org_policy.rs b/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),
},