Jelajahi Sumber

fix: ensure authentication is array, not struct

Zhongwen Deng 3 tahun lalu
induk
melakukan
0b07561e9b
1 mengubah file dengan 1 tambahan dan 4 penghapusan
  1. 1 4
      apps/emqx/src/emqx_authentication_config.erl

+ 1 - 4
apps/emqx/src/emqx_authentication_config.erl

@@ -64,7 +64,7 @@
 pre_config_update(_, UpdateReq, OldConfig) ->
     try do_pre_config_update(UpdateReq, to_list(OldConfig)) of
         {error, Reason} -> {error, Reason};
-        {ok, NewConfig} -> {ok, return_map(NewConfig)}
+        {ok, NewConfig} -> {ok, NewConfig}
     catch
         throw:Reason ->
             {error, Reason}
@@ -225,9 +225,6 @@ do_check_config(Type, Config, Module) ->
             throw({bad_authenticator_config, #{type => Type, reason => E}})
     end.
 
-return_map([L]) -> L;
-return_map(L) -> L.
-
 to_list(undefined) -> [];
 to_list(M) when M =:= #{} -> [];
 to_list(M) when is_map(M) -> [M];