fix(exhook): fix bad variable name
This commit is contained in:
parent
da80343108
commit
658ed81cfa
|
@ -34,7 +34,6 @@
|
||||||
, unload_server/1
|
, unload_server/1
|
||||||
, unload_exhooks/0
|
, unload_exhooks/0
|
||||||
, init_hooks_cnter/0
|
, init_hooks_cnter/0
|
||||||
, deinit_hooks_cnter/0
|
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -57,7 +56,6 @@ start(_StartType, _StartArgs) ->
|
||||||
prep_stop(State) ->
|
prep_stop(State) ->
|
||||||
emqx_ctl:unregister_command(exhook),
|
emqx_ctl:unregister_command(exhook),
|
||||||
_ = unload_exhooks(),
|
_ = unload_exhooks(),
|
||||||
_ = deinit_hooks_cnter(),
|
|
||||||
ok = unload_all_servers(),
|
ok = unload_all_servers(),
|
||||||
State.
|
State.
|
||||||
|
|
||||||
|
@ -94,5 +92,3 @@ init_hooks_cnter() ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
deinit_hooks_cnter() ->
|
|
||||||
ets:delete(?CNTER).
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ on_client_authenticate(ClientInfo, AuthResult) ->
|
||||||
|
|
||||||
case call_fold('client.authenticate', Req,
|
case call_fold('client.authenticate', Req,
|
||||||
fun merge_responsed_bool/2) of
|
fun merge_responsed_bool/2) of
|
||||||
{StopOrOk, #{result := Bool}} when is_boolean(Bool) ->
|
{StopOrOk, #{result := Result0}} when is_boolean(Result0) ->
|
||||||
Result = case Bool of true -> success; _ -> not_authorized end,
|
Result = case Result0 of true -> success; _ -> not_authorized end,
|
||||||
{StopOrOk, AuthResult#{auth_result => Result, anonymous => false}};
|
{StopOrOk, AuthResult#{auth_result => Result, anonymous => false}};
|
||||||
_ ->
|
_ ->
|
||||||
{ok, AuthResult}
|
{ok, AuthResult}
|
||||||
|
@ -116,8 +116,8 @@ on_client_check_acl(ClientInfo, PubSub, Topic, Result) ->
|
||||||
},
|
},
|
||||||
case call_fold('client.check_acl', Req,
|
case call_fold('client.check_acl', Req,
|
||||||
fun merge_responsed_bool/2) of
|
fun merge_responsed_bool/2) of
|
||||||
{StopOrOk, #{result := Bool}} when is_boolean(Bool) ->
|
{StopOrOk, #{result := Result0}} when is_boolean(Result0) ->
|
||||||
NResult = case Bool of true -> allow; _ -> deny end,
|
NResult = case Result0 of true -> allow; _ -> deny end,
|
||||||
{StopOrOk, NResult};
|
{StopOrOk, NResult};
|
||||||
_ -> {ok, Result}
|
_ -> {ok, Result}
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue