analytics/test/support/test_controller.ex
Artur Pata cac4ad20c9
Allow configuring AuthorizeSiteAccess plug site param (#4597)
* Stop typescript command clearing previous server start output in dev

* Allow auth site access plug to specify that domain is found in request body at some key

* Fix init order

* Make domain retrieval part of the role pipeline

* Add tests

* Refactor how is_binary is applied in get_domain/2

* Make plug tests rely on dedicated test routes for more stability

* Consistently treat empty `allowed_roles` list as permitting all roles

* Fix async test param, add extra case for init

* Make `DocsQueryTest` async again

* Improve a bit and document plug configuration

* Make docs more legible when viewed from source directly

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-09-26 09:52:45 +00:00

12 lines
251 B
Elixir

defmodule PlausibleWeb.TestController do
use PlausibleWeb, :controller
def browser_basic(conn, _params) do
send_resp(conn, 200, "ok")
end
def api_basic(conn, _params) do
send_resp(conn, 200, Jason.encode!(%{"ok" => true}))
end
end