util.sasl.plain: Reduce some code.
--- a/util/sasl/plain.lua Tue Dec 11 23:40:30 2012 +0100
+++ b/util/sasl/plain.lua Sat Dec 15 07:06:45 2012 +0500
@@ -66,15 +66,11 @@
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)