mirror of
https://github.com/plausible/analytics.git
synced 2024-11-28 04:30:42 +03:00
17 lines
298 B
Elixir
17 lines
298 B
Elixir
defmodule PlausibleWeb.RequireLoggedOutPlug do
|
|
def init(options) do
|
|
options
|
|
end
|
|
|
|
def call(conn, _opts) do
|
|
cond do
|
|
conn.assigns[:current_user] ->
|
|
conn
|
|
|> Phoenix.Controller.redirect(to: "/")
|
|
|> Plug.Conn.halt
|
|
:else ->
|
|
conn
|
|
end
|
|
end
|
|
end
|