Backward compatibility for ejabberd 16.x
This commit is contained in:
parent
5359c2a0dd
commit
4f2b61ad6e
|
@ -16,6 +16,7 @@
|
||||||
-export([start/1,
|
-export([start/1,
|
||||||
set_password/3,
|
set_password/3,
|
||||||
check_password/4,
|
check_password/4,
|
||||||
|
check_password/3,
|
||||||
check_password/6,
|
check_password/6,
|
||||||
try_register/3,
|
try_register/3,
|
||||||
dirty_get_registered_users/0,
|
dirty_get_registered_users/0,
|
||||||
|
@ -81,6 +82,18 @@ check_password(LUser, _AuthzId, LServer, Password) ->
|
||||||
{ok, true} =:= verify_scram_password(LUser, LServer, Password)
|
{ok, true} =:= verify_scram_password(LUser, LServer, Password)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec check_password(ejabberd:luser(), ejabberd:lserver(), binary()) -> boolean().
|
||||||
|
check_password(LUser, LServer, Password) ->
|
||||||
|
case scram2:enabled(LServer) of
|
||||||
|
false ->
|
||||||
|
case make_req(get, <<"check_password">>, LUser, LServer, Password) of
|
||||||
|
{ok, <<"true">>} -> true;
|
||||||
|
_ -> false
|
||||||
|
end;
|
||||||
|
true ->
|
||||||
|
{ok, true} =:= verify_scram_password(LUser, LServer, Password)
|
||||||
|
end.
|
||||||
|
|
||||||
-spec check_password(ejabberd:luser(), binary(), ejabberd:lserver(), binary(), binary(), fun()) -> boolean().
|
-spec check_password(ejabberd:luser(), binary(), ejabberd:lserver(), binary(), binary(), fun()) -> boolean().
|
||||||
check_password(LUser, _AuthzId, LServer, Password, Digest, DigestGen) ->
|
check_password(LUser, _AuthzId, LServer, Password, Digest, DigestGen) ->
|
||||||
case make_req(get, <<"get_password">>, LUser, LServer, <<"">>) of
|
case make_req(get, <<"get_password">>, LUser, LServer, <<"">>) of
|
||||||
|
|
Loading…
Reference in New Issue