# HG changeset patch
# User Waqas Hussain <waqas20@gmail.com>
# Date 1355537205 -18000
# Node ID 864b27ddaa1024e64748fed5b4bca537bea9216c
# Parent  0cc0359d8c39c116f5476aaeaef1767ae36ebddf
util.sasl.plain: Reduce some code.

diff -r 0cc0359d8c39 -r 864b27ddaa10 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)