# HG changeset patch # User Matthew Wild # Date 1640181841 0 # Node ID af6143cf7d22f655d5af1adc32d31191a01198fe # Parent caf7e88dc9e576fdba530b1ab52963fdd581b97c mod_password_policy: Hard failure on missing/empty passwords diff -r caf7e88dc9e5 -r af6143cf7d22 mod_password_policy/mod_password_policy.lua --- a/mod_password_policy/mod_password_policy.lua Wed Dec 22 14:03:25 2021 +0000 +++ b/mod_password_policy/mod_password_policy.lua Wed Dec 22 14:04:01 2021 +0000 @@ -20,6 +20,10 @@ local st = require "util.stanza"; function check_password(password, additional_info) + if not password or password == "" then + return nil, "No password provided", "no-password"; + end + if #password < options.length then return nil, ("Password is too short (minimum %d characters)"):format(options.length), "length"; end