fix(logs): print the correct username and clientid

This commit is contained in:
JianBo He 2021-01-21 10:31:43 +08:00 committed by JianBo He
parent 17ee5b0af5
commit f59377adf5
1 changed files with 3 additions and 4 deletions

View File

@ -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