Diff

util/sasl/plain.lua @ 8095:57192cf193c7

util.sasl.plain,scram: Record username in sasl state earlier
author Kim Alvefur <zash@zash.se>
date Wed, 19 Apr 2017 06:47:02 +0200
parent 6777:5de6b93d0190
child 8555:4f0f5b49bb03
line wrap: on
line diff
--- a/util/sasl/plain.lua	Wed Apr 19 12:40:03 2017 +0100
+++ b/util/sasl/plain.lua	Wed Apr 19 06:47:02 2017 +0200
@@ -63,6 +63,8 @@
 		end
 	end
 
+	self.username = authentication
+
 	local correct, state = false, false;
 	if self.profile.plain then
 		local correct_password;
@@ -72,7 +74,6 @@
 		correct, state = self.profile.plain_test(self, authentication, password, self.realm);
 	end
 
-	self.username = authentication
 	if state == false then
 		return "failure", "account-disabled";
 	elseif state == nil or not correct then