From 89e94b1d91828f94d41ad3d4b02c734da7706ff2 Mon Sep 17 00:00:00 2001 From: Stefan Melmuk Date: Thu, 6 Apr 2023 22:34:05 +0200 Subject: [PATCH] check if reset policy is enabled --- src/db/models/org_policy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/models/org_policy.rs b/src/db/models/org_policy.rs index c9fd5c34..8b3f1271 100644 --- 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::>(&policy.data) { Ok(opts) => { - return opts.data.AutoEnrollEnabled; + return policy.enabled && opts.data.AutoEnrollEnabled; } _ => error!("Failed to deserialize ResetPasswordDataModel: {}", policy.data), },