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
Use GET instead of POST for logout
Uku Tahte12b9fa42c1e
diff --git a/lib/plausible_web/router.ex b/lib/plausible_web/router.exindex 2ec1d8a86d..78cb526646 100644--- a/lib/plausible_web/router.ex+++ b/lib/plausible_web/router.ex@@ -122,7 +122,7 @@ defmodule PlausibleWeb.Router doget "/password", AuthController, :password_formpost "/password", AuthController, :set_password- post "/logout", AuthController, :logout+ get "/logout", AuthController, :logoutget "/settings", AuthController, :user_settingsput "/settings", AuthController, :save_settingsdelete "/me", AuthController, :delete_mediff --git a/lib/plausible_web/templates/layout/_header.html.eex b/lib/plausible_web/templates/layout/_header.html.eexindex bada40a729..9c2c42c30e 100644--- a/lib/plausible_web/templates/layout/_header.html.eex+++ b/lib/plausible_web/templates/layout/_header.html.eex@@ -39,7 +39,7 @@<div data-dropdown style="top: 42px; right: 0px; width: 185px;" class="absolute right-0 z-10 hidden bg-white border border-gray-300 rounded shadow-md dropdown-content dark:bg-gray-800 dark:border-gray-500"><%= link("Settings", to: "/settings", class: "block py-2 px-2 border-b border-gray-300 dark:border-gray-500 hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-gray-100") %>- <%= link("Log out", to: "/logout", method: :post, class: "block py-2 px-2 hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-gray-100") %>+ <%= link("Log out", to: "/logout", class: "block py-2 px-2 hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-gray-100") %></div></div></li>diff --git a/test/plausible_web/controllers/admin_auth_controller_test.exs b/test/plausible_web/controllers/admin_auth_controller_test.exsindex c3056342f5..282dac10b6 100644--- a/test/plausible_web/controllers/admin_auth_controller_test.exs+++ b/test/plausible_web/controllers/admin_auth_controller_test.exs@@ -23,7 +23,7 @@ defmodule PlausibleWeb.AdminAuthControllerTest doassert redirected_to(conn) == "/sites"# trying logging out- conn = post(conn, "/logout")+ conn = get(conn, "/logout")assert redirected_to(conn) == "/"conn = get(conn, "/")assert redirected_to(conn) == "/sites"