mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 11:12:15 +03:00
Don't set session if user isn't logged in
This commit is contained in:
parent
9e0a45629e
commit
1fc7442ad0
@ -17,7 +17,7 @@ defmodule PlausibleWeb.StatsController do
|
||||
|
||||
conn
|
||||
|> assign(:skip_plausible_tracking, !demo)
|
||||
|> put_session(site.domain <> "_offer_email_report", nil)
|
||||
|> remove_email_report_banner(site)
|
||||
|> put_resp_header("x-robots-tag", "noindex")
|
||||
|> render("stats.html",
|
||||
site: site,
|
||||
@ -122,5 +122,13 @@ defmodule PlausibleWeb.StatsController do
|
||||
user -> Plausible.Sites.is_owner?(user.id, site)
|
||||
end
|
||||
end
|
||||
|
||||
defp remove_email_report_banner(conn, site) do
|
||||
if conn.assigns[:current_user] do
|
||||
put_session(conn, site.domain <> "_offer_email_report", nil)
|
||||
else
|
||||
conn
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user