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.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl
index 34d4a52b2..9985dd3de 100644
--- a/src/ejabberd_auth.erl
+++ b/src/ejabberd_auth.erl
@@ -71,7 +71,7 @@
-callback get_vh_registered_users(binary(), opts()) -> [{binary(), binary()}].
-callback get_vh_registered_users_number(binary()) -> number().
-callback get_vh_registered_users_number(binary(), opts()) -> number().
--callback get_password(binary(), binary()) -> false | binary().
+-callback get_password(binary(), binary()) -> false | binary() | {binary(), binary(), binary(), integer()}.
-callback get_password_s(binary(), binary()) -> binary().
start() ->
@@ -267,7 +267,7 @@ get_vh_registered_users_number(Server, Opts) ->
end,
auth_modules(Server))).
--spec get_password(binary(), binary()) -> false | binary().
+-spec get_password(binary(), binary()) -> false | binary() | {binary(), binary(), binary(), integer()}.
get_password(User, Server) ->
lists:foldl(fun (M, false) ->
@@ -425,6 +425,10 @@ auth_modules() ->
%% Return the list of authenticated modules for a given host
auth_modules(Server) ->
LServer = jlib:nameprep(Server),
+ Default = case gen_mod:default_db(LServer) of
+ mnesia -> internal;
+ DBType -> DBType
+ end,
Methods = ejabberd_config:get_option(
{auth_method, LServer},
fun(V) when is_list(V) ->
@@ -432,7 +436,7 @@ auth_modules(Server) ->
V;
(V) when is_atom(V) ->
[V]
- end, []),
+ end, [Default]),
[jlib:binary_to_atom(<<"ejabberd_auth_",
(jlib:atom_to_binary(M))/binary>>)
|| M <- Methods].