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
defmodule PlausibleWeb.RequireLoggedOutPlug do
@moduledoc """
Plug forcibly logging user out if they are authenticated.
"""
import Plug.Conn
def init(opts \\ []) do
opts
end
def call(conn, _opts) do
if conn.assigns[:current_user] do
conn
|> PlausibleWeb.UserAuth.set_logged_in_cookie()
|> Phoenix.Controller.redirect(to: "/sites")
|> halt()
else
conn
end
end
end