From f59377adf5bb5e39b3107aa794c091bbae1b520b Mon Sep 17 00:00:00 2001 From: JianBo He Date: Thu, 21 Jan 2021 10:31:43 +0800 Subject: [PATCH] fix(logs): print the correct username and clientid --- src/emqx_channel.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/emqx_channel.erl b/src/emqx_channel.erl index 5fd0a25c7..8511672c3 100644 --- a/src/emqx_channel.erl +++ b/src/emqx_channel.erl @@ -1187,11 +1187,10 @@ check_banned(_ConnPkt, #channel{clientinfo = ClientInfo = #{zone := Zone}}) -> %%-------------------------------------------------------------------- %% Auth Connect -auth_connect(#mqtt_packet_connect{clientid = ClientId, - username = Username, - password = Password - }, +auth_connect(#mqtt_packet_connect{password = Password}, #channel{clientinfo = ClientInfo} = Channel) -> + #{clientid := ClientId, + username := Username} = ClientInfo, case emqx_access_control:authenticate(ClientInfo#{password => Password}) of {ok, AuthResult} -> is_anonymous(AuthResult) andalso