1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/lib/chess_web/controllers/page_controller.ex

16 lines
320 B
Elixir

defmodule ChessWeb.PageController do
@moduledoc false
use ChessWeb, :controller
import Chess.Auth, only: [current_user: 1]
def index(conn, _params) do
if current_user(conn) != nil do
conn |> redirect(to: game_path(conn, :index)) |> halt()
else
render(conn, "index.html")
end
end
end