fix(ldap): Return correct reason code when password is wrong
This commit is contained in:
parent
4163f06611
commit
037b0a7599
|
@ -249,7 +249,7 @@ verify_password(Algorithm, LDAPPasswordType, LDAPPassword, Salt, Position, Passw
|
|||
true ->
|
||||
{ok, is_superuser(Entry, State)};
|
||||
_ ->
|
||||
{error, invalid_password}
|
||||
{error, bad_username_or_password}
|
||||
end.
|
||||
|
||||
is_superuser(Entry, #{is_superuser_attribute := Attr} = _State) ->
|
||||
|
|
|
@ -237,7 +237,7 @@ user_seeds() ->
|
|||
%% Not exists
|
||||
New(<<"notexists">>, <<"notexists">>, {error, not_authorized}),
|
||||
%% Wrong Password
|
||||
New(<<"mqttuser0001">>, <<"wrongpassword">>, {error, invalid_password}),
|
||||
New(<<"mqttuser0001">>, <<"wrongpassword">>, {error, bad_username_or_password}),
|
||||
%% Disabled
|
||||
New(<<"mqttuser0006">>, <<"mqttuser0006">>, {error, user_disabled}),
|
||||
%% IsSuperuser
|
||||
|
|
Loading…
Reference in New Issue