util.sasl.scram: Store username property rather than cached local (#399)
authorMatthew Wild <mwild1@gmail.com>
Tue, 07 Dec 2021 16:23:23 +0000
changeset 12028 9184bdda22be
parent 12027 5a3781a12285
child 12029 6ed7fd28f5e3
util.sasl.scram: Store username property rather than cached local (#399) This should allow modules to override the username in a profile handler by assigning to self.username.
util/sasl/scram.lua
--- a/util/sasl/scram.lua	Tue Dec 07 13:21:20 2021 +0100
+++ b/util/sasl/scram.lua	Tue Dec 07 16:23:23 2021 +0000
@@ -175,7 +175,7 @@
 			self.state = {
 				gs2_header = gs2_header;
 				gs2_cbind_name = gs2_cbind_name;
-				username = username;
+				username = self.username; -- Reference property instead of local, in case it was modified by the profile
 				nonce = nonce;
 
 				server_key = server_key;