diff --git a/lib/clacks_web/views/layout_view.ex b/lib/clacks_web/views/layout_view.ex index 305d5f1..8d8cebf 100644 --- a/lib/clacks_web/views/layout_view.ex +++ b/lib/clacks_web/views/layout_view.ex @@ -1,3 +1,21 @@ defmodule ClacksWeb.LayoutView do use ClacksWeb, :view + alias ClacksWeb.Router.Helpers, as: Routes + + def instance_name do + Application.get_env(:clacks, :instance, %{}) |> Keyword.get(:name) + end + + def login_path(conn) do + params = + case Phoenix.Controller.current_path(conn) do + "/" -> + [] + + path -> + [continue: path] + end + + Routes.login_path(conn, :login, params) + end end