chore: update emqx_authn.appup.src

This commit is contained in:
JianBo He 2022-06-30 15:23:09 +08:00
parent 7de23f5863
commit 9acfd0ff9e
3 changed files with 19 additions and 24 deletions

View File

@ -1,5 +1,11 @@
%% -*- mode: erlang -*- %% -*- mode: erlang -*-
%% Unless you know what you are doing, DO NOT edit manually!! %% Unless you know what you are doing, DO NOT edit manually!!
{VSN, {VSN,
[{"0.1.0",[{load_module,emqx_authn_utils,brutal_purge,soft_purge,[]}]}], [{"0.1.0",[
[{"0.1.0",[{load_module,emqx_authn_utils,brutal_purge,soft_purge,[]}]}]}. {load_module,emqx_authn_utils,brutal_purge,soft_purge,[]},
{load_module,emqx_authn_redis,brutal_purge,soft_purge,[]}]
}],
[{"0.1.0",[
{load_module,emqx_authn_utils,brutal_purge,soft_purge,[]},
{load_module,emqx_authn_redis,brutal_purge,soft_purge,[]}]
}]}.

View File

@ -80,7 +80,7 @@ check_password_from_selected_map(Algorithm, Selected, Password) ->
), ),
case Hash of case Hash of
undefined -> undefined ->
{error, bad_username_or_password}; {error, not_authorized};
_ -> _ ->
Salt = maps:get(<<"salt">>, Selected, <<>>), Salt = maps:get(<<"salt">>, Selected, <<>>),
case case

View File

@ -138,8 +138,7 @@ authenticate(
{ok, []} -> {ok, []} ->
ignore; ignore;
{ok, Values} -> {ok, Values} ->
case merge(Fields, Values) of Selected = merge(Fields, Values),
#{<<"password_hash">> := _} = Selected ->
case case
emqx_authn_utils:check_password_from_selected_map( emqx_authn_utils:check_password_from_selected_map(
Algorithm, Selected, Password Algorithm, Selected, Password
@ -150,16 +149,6 @@ authenticate(
{error, Reason} -> {error, Reason} ->
{error, Reason} {error, Reason}
end; end;
_ ->
?SLOG(error, #{
msg => "cannot_find_password_hash_field",
cmd => Command,
keys => NKey,
fields => Fields,
resource => ResourceId
}),
ignore
end;
{error, Reason} -> {error, Reason} ->
?SLOG(error, #{ ?SLOG(error, #{
msg => "redis_query_failed", msg => "redis_query_failed",