diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-30 17:15:43 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-30 17:15:43 +0300 |
commit | 253ec139711a71d3f7b17aa91b0fba17874e1dc3 (patch) | |
tree | ffb0025445a524b2ff6cf17679e5d7275f21361c /src/ejabberd_auth_anonymous.erl | |
parent | Avoid using broad p1_queue:queue() type wherever possible (diff) |
Use new ets_cache API in ejabberd_auth
Diffstat (limited to 'src/ejabberd_auth_anonymous.erl')
-rw-r--r-- | src/ejabberd_auth_anonymous.erl | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl index 805076af..efccdd8a 100644 --- a/src/ejabberd_auth_anonymous.erl +++ b/src/ejabberd_auth_anonymous.erl @@ -148,16 +148,14 @@ unregister_connection(_SID, %% Specific anonymous auth functions %% --------------------------------- check_password(User, _AuthzId, Server, _Password) -> - case - ejabberd_auth:user_exists_in_other_modules(?MODULE, - User, Server) - of - %% If user exists in other module, reject anonnymous authentication - true -> false; - %% If we are not sure whether the user exists in other module, reject anon auth - maybe -> false; - false -> login(User, Server) - end. + {nocache, + case ejabberd_auth:user_exists_in_other_modules(?MODULE, User, Server) of + %% If user exists in other module, reject anonnymous authentication + true -> false; + %% If we are not sure whether the user exists in other module, reject anon auth + maybe -> false; + false -> login(User, Server) + end}. login(User, Server) -> case is_login_anonymous_enabled(Server) of @@ -180,7 +178,7 @@ count_users(Server, Opts) -> length(get_users(Server, Opts)). user_exists(User, Server) -> - anonymous_user_exist(User, Server). + {nocache, anonymous_user_exist(User, Server)}. plain_password_required(_) -> false. |