Fix auth fail

This commit is contained in:
turtled 2019-08-09 17:37:55 +08:00
parent 31cc446818
commit a93f8c6788
1 changed files with 2 additions and 2 deletions

View File

@ -31,9 +31,9 @@
-spec(authenticate(emqx_types:client())
-> {ok, #{auth_result := emqx_types:auth_result(),
anonymous := boolean}} | {error, term()}).
authenticate(Client = #{zone := Zone}) ->
authenticate(Client) ->
case emqx_hooks:run_fold('client.authenticate',
[Client], default_auth_result(Zone)) of
[Client], default_auth_result(maps:get(zone, Client, undefined))) of
Result = #{auth_result := success, anonymous := true} ->
emqx_metrics:inc('auth.mqtt.anonymous'),
{ok, Result};