Software /
code /
prosody-modules
Comparison
mod_password_policy/mod_password_policy.lua @ 4830:af6143cf7d22
mod_password_policy: Hard failure on missing/empty passwords
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 22 Dec 2021 14:04:01 +0000 |
parent | 4829:caf7e88dc9e5 |
child | 4831:5a42cb84c8ee |
comparison
equal
deleted
inserted
replaced
4829:caf7e88dc9e5 | 4830:af6143cf7d22 |
---|---|
18 end | 18 end |
19 | 19 |
20 local st = require "util.stanza"; | 20 local st = require "util.stanza"; |
21 | 21 |
22 function check_password(password, additional_info) | 22 function check_password(password, additional_info) |
23 if not password or password == "" then | |
24 return nil, "No password provided", "no-password"; | |
25 end | |
26 | |
23 if #password < options.length then | 27 if #password < options.length then |
24 return nil, ("Password is too short (minimum %d characters)"):format(options.length), "length"; | 28 return nil, ("Password is too short (minimum %d characters)"):format(options.length), "length"; |
25 end | 29 end |
26 | 30 |
27 if additional_info then | 31 if additional_info then |