util.sasl.plain: Reduce some code.
authorWaqas Hussain <waqas20@gmail.com>
Sat, 15 Dec 2012 07:06:45 +0500
changeset 5240 864b27ddaa10
parent 5238 0cc0359d8c39
child 5241 4516e6bd51b4
util.sasl.plain: Reduce some code.
util/sasl/plain.lua
--- 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)