chore: update emqx_authn.appup.src
This commit is contained in:
parent
7de23f5863
commit
9acfd0ff9e
|
@ -1,5 +1,11 @@
|
|||
%% -*- mode: erlang -*-
|
||||
%% Unless you know what you are doing, DO NOT edit manually!!
|
||||
{VSN,
|
||||
[{"0.1.0",[{load_module,emqx_authn_utils,brutal_purge,soft_purge,[]}]}],
|
||||
[{"0.1.0",[{load_module,emqx_authn_utils,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,[]}]
|
||||
}],
|
||||
[{"0.1.0",[
|
||||
{load_module,emqx_authn_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_authn_redis,brutal_purge,soft_purge,[]}]
|
||||
}]}.
|
||||
|
|
|
@ -80,7 +80,7 @@ check_password_from_selected_map(Algorithm, Selected, Password) ->
|
|||
),
|
||||
case Hash of
|
||||
undefined ->
|
||||
{error, bad_username_or_password};
|
||||
{error, not_authorized};
|
||||
_ ->
|
||||
Salt = maps:get(<<"salt">>, Selected, <<>>),
|
||||
case
|
||||
|
|
|
@ -138,27 +138,16 @@ authenticate(
|
|||
{ok, []} ->
|
||||
ignore;
|
||||
{ok, Values} ->
|
||||
case merge(Fields, Values) of
|
||||
#{<<"password_hash">> := _} = Selected ->
|
||||
case
|
||||
emqx_authn_utils:check_password_from_selected_map(
|
||||
Algorithm, Selected, Password
|
||||
)
|
||||
of
|
||||
ok ->
|
||||
{ok, emqx_authn_utils:is_superuser(Selected)};
|
||||
{error, Reason} ->
|
||||
{error, Reason}
|
||||
end;
|
||||
_ ->
|
||||
?SLOG(error, #{
|
||||
msg => "cannot_find_password_hash_field",
|
||||
cmd => Command,
|
||||
keys => NKey,
|
||||
fields => Fields,
|
||||
resource => ResourceId
|
||||
}),
|
||||
ignore
|
||||
Selected = merge(Fields, Values),
|
||||
case
|
||||
emqx_authn_utils:check_password_from_selected_map(
|
||||
Algorithm, Selected, Password
|
||||
)
|
||||
of
|
||||
ok ->
|
||||
{ok, emqx_authn_utils:is_superuser(Selected)};
|
||||
{error, Reason} ->
|
||||
{error, Reason}
|
||||
end;
|
||||
{error, Reason} ->
|
||||
?SLOG(error, #{
|
||||
|
|
Loading…
Reference in New Issue