Packages

This is a CMS written in Elixir. Aims to be the great open-source ecommerce and/or startup solution for those who are searching for a performance and stability on top of modern technologies like React and Elixir.

Current section

Files

Jump to
lyn web helpers auth_helper.ex
Raw

web/helpers/auth_helper.ex

defmodule Lyn.AuthHelper do
def active_on_current(%{request_path: path}, path), do: "active"
def active_on_current(_, _), do: ""
def admin_logged_in?(conn), do: Guardian.Plug.authenticated?(conn, :admin)
def admin_user(conn), do: Guardian.Plug.current_resource(conn, :admin)
def logged_in?(conn), do: Guardian.Plug.authenticated?(conn)
def current_user(conn), do: Guardian.Plug.current_resource(conn)
end