Merge with Tobias's SASL redesign branch
[prosody.git] / util / sasl / plain.lua
index d9fdb9a2f9ff1f5b25bba685fa3a4227301f5551..46a86bb92ef65239535756a58a53dcd1c5de65f1 100644 (file)
@@ -34,7 +34,8 @@ local function plain(self, message)
        password = saslprep(password);
        
        if (not password) or (password == "") or (not authentication) or (authentication == "") then
-               log("debug", "Username or password violates either SASLprep.");
+               log("debug", "Username or password violates SASLprep.");
+               return "failure", "malformed-request", "Invalid username or password.";
        end
 
        local correct, state = false, false;
@@ -54,7 +55,7 @@ local function plain(self, message)
        if correct then
                return "success";
        else
-               return "failure", "not-authorized";
+               return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
        end
 end