aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_auth.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ejabberd_auth.erl')
-rw-r--r--src/ejabberd_auth.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl
index d937340f1..1eab9af83 100644
--- a/src/ejabberd_auth.erl
+++ b/src/ejabberd_auth.erl
@@ -50,7 +50,7 @@
remove_user/2,
remove_user/3,
plain_password_required/1,
- storage_type/1,
+ store_type/1,
entropy/1
]).
@@ -70,25 +70,26 @@ start() ->
end, auth_modules(Host))
end, ?MYHOSTS).
+%% This is only executed by ejabberd_c2s for non-SASL auth client
plain_password_required(Server) ->
lists:any(
fun(M) ->
M:plain_password_required()
end, auth_modules(Server)).
-storage_type(Server) ->
+store_type(Server) ->
lists:foldl(
fun(_, external) ->
external;
(M, scram) ->
- case M:storage_type() of
+ case M:store_type() of
external ->
external;
_Else ->
scram
end;
(M, plain) ->
- M:storage_type()
+ M:store_type()
end, plain, auth_modules(Server)).
%% @doc Check if the user and password can login in server.
@@ -248,8 +249,10 @@ get_password_s(User, Server) ->
case get_password(User, Server) of
false ->
"";
- Password ->
- Password
+ Password when is_list(Password) ->
+ Password;
+ _ ->
+ ""
end.
%% @doc Get the password of the user and the auth module.