Correctly support cache tags in ejabberd_auth
This commit is contained in:
parent
0789a145fc
commit
7c45b52c86
|
@ -613,7 +613,10 @@ db_user_exists(User, Server, Mod) ->
|
||||||
case Mod:user_exists(User, Server) of
|
case Mod:user_exists(User, Server) of
|
||||||
true -> {ok, exists};
|
true -> {ok, exists};
|
||||||
false -> error;
|
false -> error;
|
||||||
{error, _} = Err -> Err
|
{error, _} = Err -> Err;
|
||||||
|
{CacheTag, true} -> {CacheTag, {ok, exists}};
|
||||||
|
{CacheTag, false} -> {CacheTag, error};
|
||||||
|
{_, {error, _}} = Err -> Err
|
||||||
end
|
end
|
||||||
end) of
|
end) of
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
|
@ -643,10 +646,10 @@ db_check_password(User, AuthzId, Server, ProvidedPassword,
|
||||||
fun() ->
|
fun() ->
|
||||||
case Mod:check_password(
|
case Mod:check_password(
|
||||||
User, AuthzId, Server, ProvidedPassword) of
|
User, AuthzId, Server, ProvidedPassword) of
|
||||||
true ->
|
true -> {ok, ProvidedPassword};
|
||||||
{ok, ProvidedPassword};
|
false -> error;
|
||||||
false ->
|
{CacheTag, true} -> {CacheTag, {ok, ProvidedPassword}};
|
||||||
error
|
{CacheTag, false} -> {CacheTag, error}
|
||||||
end
|
end
|
||||||
end) of
|
end) of
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
|
|
Loading…
Reference in New Issue