defmodule ChiyaWeb.UserLoginLive do use ChiyaWeb, :live_view def render(assigns) do ~H"""
<.header class="text-center"> Sign in to account <:subtitle> Don't have an account? <.link navigate={~p"/user/register"} class="font-semibold text-brand hover:underline"> Sign up for an account now. <.simple_form for={@form} id="login_form" action={~p"/user/log_in"} phx-update="ignore"> <.input field={@form[:email]} type="email" label="Email" required /> <.input field={@form[:password]} type="password" label="Password" required /> <:actions> <.input field={@form[:remember_me]} type="checkbox" label="Keep me logged in" /> <.link href={~p"/user/reset_password"} class="text-sm font-semibold dark:text-gray-100"> Forgot your password? <:actions> <.button phx-disable-with="Signing in..." class="w-full"> Sign in
""" end def mount(_params, _session, socket) do email = live_flash(socket.assigns.flash, :email) form = to_form(%{"email" => email}, as: "user") {:ok, assign(socket, form: form), temporary_assigns: [form: form]} end end