refactor(gateway): re-use `emqx_authentication_config:authenticator_id/1`
This commit is contained in:
parent
af4ad5721f
commit
bdc1253d96
|
@ -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),
|
emqx_authentication_config:authenticator_id(Authn);
|
||||||
BackendBin = atom_to_binary(Backend),
|
|
||||||
<<MechanismBin/binary, ":", BackendBin/binary>>;
|
|
||||||
get_authn_type(_) ->
|
get_authn_type(_) ->
|
||||||
<<"undefined">>.
|
<<"undefined">>.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue