Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Make cookie accessible to JS
Uku Taht1b9cc038a319
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.exindex 9bc7395e36..67dbd81899 100644--- a/lib/plausible_web/controllers/auth_controller.ex+++ b/lib/plausible_web/controllers/auth_controller.ex@@ -38,7 +38,7 @@ defmodule PlausibleWeb.AuthController doconn|> put_session(:current_user_id, user.id)- |> put_resp_cookie("logged_in", "true")+ |> put_resp_cookie("logged_in", "true", http_only: false)|> redirect(to: "/password"){:error, changeset} ->send_resp(conn, 400, inspect(changeset.errors))@@ -121,7 +121,7 @@ defmodule PlausibleWeb.AuthController doconn|> put_session(:current_user_id, user.id)- |> put_resp_cookie("logged_in", "true")+ |> put_resp_cookie("logged_in", "true", http_only: false)|> put_session(:login_dest, nil)|> redirect(to: login_dest)elsediff --git a/lib/plausible_web/plugs/require_logged_out.ex b/lib/plausible_web/plugs/require_logged_out.exindex 487d375670..934cf5d73a 100644--- a/lib/plausible_web/plugs/require_logged_out.ex+++ b/lib/plausible_web/plugs/require_logged_out.ex@@ -9,7 +9,7 @@ defmodule PlausibleWeb.RequireLoggedOutPlug docond doconn.assigns[:current_user] ->conn- |> put_resp_cookie("logged_in", "true")+ |> put_resp_cookie("logged_in", "true", http_only: false)|> Phoenix.Controller.redirect(to: "/")|> halt:else ->