Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Do not allow logged out users to access crm

Uku Taht97df923c7f9e
diff --git a/lib/plausible_web/plugs/crm_auth_plug.ex b/lib/plausible_web/plugs/crm_auth_plug.ex
index 7f28539981..bfffad0922 100644
--- a/lib/plausible_web/plugs/crm_auth_plug.ex
+++ b/lib/plausible_web/plugs/crm_auth_plug.ex
@@ -9,7 +9,7 @@ defmodule PlausibleWeb.CRMAuthPlug do
def call(conn, _opts) do
case get_session(conn, :current_user_id) do
nil ->
- conn
+ conn |> send_resp(403, "Not allowed") |> halt
id ->
user = Repo.get_by(Plausible.Auth.User, id: id)