Email blacklist: Update response phrasing
authorAlex Gleason <alex@alexgleason.me>
Tue, 4 Aug 2020 00:57:53 +0000 (19:57 -0500)
committerAlex Gleason <alex@alexgleason.me>
Tue, 4 Aug 2020 00:57:53 +0000 (19:57 -0500)
lib/pleroma/user.ex
test/web/mastodon_api/controllers/account_controller_test.exs

index d0cc098fe1a1abfd4843b1e34fc8577028c5b840..16679ac4276119789deaf10e1d5e2104f1419ec4 100644 (file)
@@ -684,7 +684,7 @@ defmodule Pleroma.User do
           !String.ends_with?(email, ["@" <> blacklisted_domain, "." <> blacklisted_domain])
         end)
 
-      if valid?, do: [], else: [email: "Email domain is blacklisted"]
+      if valid?, do: [], else: [credentials: "Invalid credentials"]
     end)
     |> unique_constraint(:nickname)
     |> validate_exclusion(:nickname, Config.get([User, :restricted_nicknames]))
index 2cb3886554c345b1b5ad939e224d0457df97677d..86e3ac3e78f2de0ea2462adde08743a044b4d994 100644 (file)
@@ -956,7 +956,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
         |> put_req_header("authorization", "Bearer " <> token)
         |> post("/api/v1/accounts", params)
 
-      assert %{"error" => "{\"email\":[\"Email domain is blacklisted\"]}"} =
+      assert %{"error" => "{\"credentials\":[\"Invalid credentials\"]}"} =
                json_response_and_validate_schema(conn, 400)
 
       Pleroma.Config.put([User, :email_blacklist], [])