Просмотр исходного кода

fix(logs): print the correct username and clientid

JianBo He 5 лет назад
Родитель
Сommit
f59377adf5
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      src/emqx_channel.erl

+ 3 - 4
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