]> granicus.if.org Git - ejabberd/commitdiff
mod_register_web: Don't crash if user exists
authorHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 5 Jun 2019 16:28:35 +0000 (18:28 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 5 Jun 2019 16:28:35 +0000 (18:28 +0200)
Since commit 633b68db1130c81551b063f3aa15d599b0d355e5,
ejabberd_auth:try_register/3 returns {error, exists} rather than
{atomic, exists}.

Thanks to Thomas Leister for reporting the issue.

src/mod_register_web.erl

index 1e188d3336f13aa0e59cc51a6c076c83145d9722..4cd0deb534c0fa28a3852e0c52bf44a9f3c8a8e3 100644 (file)
@@ -590,8 +590,8 @@ unregister_account(Username, Host, Password) ->
 get_error_text({error, captcha_non_valid}) ->
     <<"The captcha you entered is wrong">>;
 get_error_text({success, exists, _}) ->
-    get_error_text({atomic, exists});
-get_error_text({atomic, exists}) ->
+    get_error_text({error, exists});
+get_error_text({error, exists}) ->
     <<"The account already exists">>;
 get_error_text({error, password_incorrect}) ->
     <<"Incorrect password">>;