Email blacklist: Update response phrasing
This commit is contained in:
parent
de3bdc63ad
commit
058daf498f
|
@ -684,7 +684,7 @@ def register_changeset(struct, params \\ %{}, opts \\ []) do
|
||||||
!String.ends_with?(email, ["@" <> blacklisted_domain, "." <> blacklisted_domain])
|
!String.ends_with?(email, ["@" <> blacklisted_domain, "." <> blacklisted_domain])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if valid?, do: [], else: [email: "Email domain is blacklisted"]
|
if valid?, do: [], else: [credentials: "Invalid credentials"]
|
||||||
end)
|
end)
|
||||||
|> unique_constraint(:nickname)
|
|> unique_constraint(:nickname)
|
||||||
|> validate_exclusion(:nickname, Config.get([User, :restricted_nicknames]))
|
|> validate_exclusion(:nickname, Config.get([User, :restricted_nicknames]))
|
||||||
|
|
|
@ -956,7 +956,7 @@ test "registers and logs in without :account_activation_required / :account_appr
|
||||||
|> put_req_header("authorization", "Bearer " <> token)
|
|> put_req_header("authorization", "Bearer " <> token)
|
||||||
|> post("/api/v1/accounts", params)
|
|> post("/api/v1/accounts", params)
|
||||||
|
|
||||||
assert %{"error" => "{\"email\":[\"Email domain is blacklisted\"]}"} =
|
assert %{"error" => "{\"credentials\":[\"Invalid credentials\"]}"} =
|
||||||
json_response_and_validate_schema(conn, 400)
|
json_response_and_validate_schema(conn, 400)
|
||||||
|
|
||||||
Pleroma.Config.put([User, :email_blacklist], [])
|
Pleroma.Config.put([User, :email_blacklist], [])
|
||||||
|
|
Loading…
Reference in New Issue