fix(ldap): Return correct reason code when password is wrong

This commit is contained in:
firest 2023-08-21 22:47:18 +08:00
parent 4163f06611
commit 037b0a7599
2 changed files with 2 additions and 2 deletions

View File

@ -249,7 +249,7 @@ verify_password(Algorithm, LDAPPasswordType, LDAPPassword, Salt, Position, Passw
true -> true ->
{ok, is_superuser(Entry, State)}; {ok, is_superuser(Entry, State)};
_ -> _ ->
{error, invalid_password} {error, bad_username_or_password}
end. end.
is_superuser(Entry, #{is_superuser_attribute := Attr} = _State) -> is_superuser(Entry, #{is_superuser_attribute := Attr} = _State) ->

View File

@ -237,7 +237,7 @@ user_seeds() ->
%% Not exists %% Not exists
New(<<"notexists">>, <<"notexists">>, {error, not_authorized}), New(<<"notexists">>, <<"notexists">>, {error, not_authorized}),
%% Wrong Password %% Wrong Password
New(<<"mqttuser0001">>, <<"wrongpassword">>, {error, invalid_password}), New(<<"mqttuser0001">>, <<"wrongpassword">>, {error, bad_username_or_password}),
%% Disabled %% Disabled
New(<<"mqttuser0006">>, <<"mqttuser0006">>, {error, user_disabled}), New(<<"mqttuser0006">>, <<"mqttuser0006">>, {error, user_disabled}),
%% IsSuperuser %% IsSuperuser