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 ->
|
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) ->
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue