aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_saslauth.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-08-05 16:31:56 +0100
committerMatthew Wild <mwild1@gmail.com>2009-08-05 16:31:56 +0100
commit43ff43e5943fc34a86348f138ce01e5e24da3f67 (patch)
tree0ae20eaedb4c47a94e329e1b9153c3164c013028 /plugins/mod_saslauth.lua
parent1181b101b526a65c3907a80839c72f48993d40bb (diff)
downloadprosody-43ff43e5943fc34a86348f138ce01e5e24da3f67.tar.gz
prosody-43ff43e5943fc34a86348f138ce01e5e24da3f67.zip
mod_saslauth: Fix traceback on attempted login for non-existent users
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r--plugins/mod_saslauth.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 87f24273..9082d69d 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -77,8 +77,12 @@ local function credentials_callback(mechanism, ...)
function func(x) return x; end
local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4];
local password = usermanager_get_password(node, domain)
- if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
- return func, md5(node..":"..realm..":"..password);
+ if password then
+ if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
+ return func, md5(node..":"..realm..":"..password);
+ else
+ return func, nil;
+ end
end
end