From a86806a4df99ab3525df117a473be8812d50a762 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 15 Dec 2012 07:06:45 +0500 Subject: util.sasl.plain: Reduce some code. --- util/sasl/plain.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'util/sasl') 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) -- cgit v1.2.3