aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2012-12-15 07:06:45 +0500
committerWaqas Hussain <waqas20@gmail.com>2012-12-15 07:06:45 +0500
commit2634362718062d08ee73ead25d1a9425f5c62de6 (patch)
tree4c20776d6a6beb4f4ebdfca47f0ea2086d7fbe79 /util/sasl
parent8c8d3b759f1d99a687f859c2ca96bf008bcd24ec (diff)
downloadprosody-2634362718062d08ee73ead25d1a9425f5c62de6.tar.gz
prosody-2634362718062d08ee73ead25d1a9425f5c62de6.zip
util.sasl.plain: Reduce some code.
Diffstat (limited to 'util/sasl')
-rw-r--r--util/sasl/plain.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/util/sasl/plain.lua b/util/sasl/plain.lua
index ba4645e1..d108a40d 100644
--- a/util/sasl/plain.lua
+++ b/util/sasl/plain.lua
@@ -66,15 +66,11 @@ local function plain(self, message)
self.username = authentication
if state == false then
return "failure", "account-disabled";
- elseif state == nil then
+ elseif state == nil or not correct then
return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
end
- if correct then
- return "success";
- else
- return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
- end
+ return "success";
end
function init(registerMechanism)