fix: ensure authentication is array, not struct

This commit is contained in:
Zhongwen Deng 2022-09-08 14:26:49 +08:00
parent 6991b42f14
commit 0b07561e9b
1 changed files with 1 additions and 4 deletions

View File

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