Parcourir la source

refactor(gateway): re-use `emqx_authentication_config:authenticator_id/1`

Thales Macedo Garitezi il y a 3 ans
Parent
commit
bdc1253d96
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      apps/emqx_gateway/src/emqx_gateway.erl

+ 2 - 4
apps/emqx_gateway/src/emqx_gateway.erl

@@ -123,12 +123,10 @@ get_basic_usage_info() ->
 %% Internal funcs
 %% 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)
     is_atom(Mechanism), is_atom(Backend)
 ->
 ->
-    MechanismBin = atom_to_binary(Mechanism),
-    BackendBin = atom_to_binary(Backend),
-    <<MechanismBin/binary, ":", BackendBin/binary>>;
+    emqx_authentication_config:authenticator_id(Authn);
 get_authn_type(_) ->
 get_authn_type(_) ->
     <<"undefined">>.
     <<"undefined">>.