From bdc1253d96d9e86cddafae87379492be18fc636c Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 5 Apr 2022 13:28:24 -0300 Subject: [PATCH] refactor(gateway): re-use `emqx_authentication_config:authenticator_id/1` --- apps/emqx_gateway/src/emqx_gateway.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/emqx_gateway/src/emqx_gateway.erl b/apps/emqx_gateway/src/emqx_gateway.erl index 12748c2a6..2269a55c6 100644 --- a/apps/emqx_gateway/src/emqx_gateway.erl +++ b/apps/emqx_gateway/src/emqx_gateway.erl @@ -123,12 +123,10 @@ get_basic_usage_info() -> %% Internal funcs %%-------------------------------------------------------------------- -get_authn_type(#{authentication := #{mechanism := Mechanism, backend := Backend}}) when +get_authn_type(#{authentication := Authn = #{mechanism := Mechanism, backend := Backend}}) when is_atom(Mechanism), is_atom(Backend) -> - MechanismBin = atom_to_binary(Mechanism), - BackendBin = atom_to_binary(Backend), - <>; + emqx_authentication_config:authenticator_id(Authn); get_authn_type(_) -> <<"undefined">>.