summaryrefslogtreecommitdiff
path: root/src/cyrsasl_anonymous.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2015-12-04 15:08:43 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2015-12-04 15:08:43 +0100
commit5c329a769904c05b21173a7e3d7bd0d95fe5d66c (patch)
treed376ac03567fe4e6bea933fffa9ee82aac16bea3 /src/cyrsasl_anonymous.erl
parenttrusted_proxies option not parsed correctly (#860) (diff)
Remove now() - part 1
Diffstat (limited to 'src/cyrsasl_anonymous.erl')
-rw-r--r--src/cyrsasl_anonymous.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cyrsasl_anonymous.erl b/src/cyrsasl_anonymous.erl
index af403645..adbde246 100644
--- a/src/cyrsasl_anonymous.erl
+++ b/src/cyrsasl_anonymous.erl
@@ -43,11 +43,11 @@ stop() -> ok.
mech_new(Host, _GetPassword, _CheckPassword, _CheckPasswordDigest) ->
{ok, #state{server = Host}}.
-mech_step(#state{server = Server}, _ClientIn) ->
- User = iolist_to_binary([randoms:get_string()
- | [jlib:integer_to_binary(X)
- || X <- tuple_to_list(now())]]),
+mech_step(#state{server = Server} = S, ClientIn) ->
+ User = iolist_to_binary([randoms:get_string(),
+ randoms:get_string(),
+ randoms:get_string()]),
case ejabberd_auth:is_user_exists(User, Server) of
- true -> {error, <<"not-authorized">>};
+ true -> mech_step(S, ClientIn);
false -> {ok, [{username, User}, {auth_module, ejabberd_auth_anonymous}]}
end.