25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Catch error when auth crashes

This commit is contained in:
Badlop 2010-05-11 00:30:32 +02:00
parent 7aa5e8f435
commit 3727e2426d

View File

@ -243,7 +243,7 @@ get_auth_admin(Auth, HostHTTP, RPath, Method) ->
end. end.
get_auth_account(HostOfRule, AccessRule, User, Server, Pass) -> get_auth_account(HostOfRule, AccessRule, User, Server, Pass) ->
case ejabberd_auth:check_password(User, Server, Pass) of case catch ejabberd_auth:check_password(User, Server, Pass) of
true -> true ->
case is_acl_match(HostOfRule, AccessRule, case is_acl_match(HostOfRule, AccessRule,
exmpp_jid:make(User, Server)) of exmpp_jid:make(User, Server)) of
@ -258,7 +258,9 @@ get_auth_account(HostOfRule, AccessRule, User, Server, Pass) ->
{unauthorized, "bad-password"}; {unauthorized, "bad-password"};
false -> false ->
{unauthorized, "inexistent-account"} {unauthorized, "inexistent-account"}
end end;
_ ->
{unauthorized, "badformed-jid"}
end. end.
%%%================================== %%%==================================