mirror of
https://github.com/plausible/analytics.git
synced 2024-12-26 02:55:02 +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
|