From 84ac4b6752c50fbbfb198a5fd83194839a52989c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 19 Apr 2017 06:47:02 +0200 Subject: util.sasl.plain,scram: Record username in sasl state earlier --- util/sasl/plain.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/sasl/plain.lua') diff --git a/util/sasl/plain.lua b/util/sasl/plain.lua index 26e65335..cd59b1ac 100644 --- a/util/sasl/plain.lua +++ b/util/sasl/plain.lua @@ -63,6 +63,8 @@ local function plain(self, message) end end + self.username = authentication + local correct, state = false, false; if self.profile.plain then local correct_password; @@ -72,7 +74,6 @@ local function plain(self, message) 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 -- cgit v1.2.3