commit 3bd4e42fb01781dce454031402ed26e92dc055e4
parent 0b28ab3be101b58cf27b43da14bcf893fa37c1c8
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Sun, 9 Apr 2023 19:02:27 +0200
Merge pull request #3427 from stefan0xC/check-if-policies-enabled
check if reset password 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),
},