prop/lib/microwaveprop_web/controllers/user_session_html/new.html.heex
Graham McIntire ac19e4795d
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 4m56s
Improve login UX and clean up unused home page template
- Replace non-standard two-button login pattern with standard
  'Keep me logged in' checkbox + single 'Log in' button
- Replace unused default Phoenix generator home page template
  with minimal app-appropriate content
2026-08-02 13:00:07 -05:00

58 lines
1.7 KiB
Text

<Layouts.app flash={@flash} current_scope={@current_scope}>
<div class="mx-auto max-w-sm space-y-4">
<div class="text-center">
<.header>
<p>Log in</p>
<:subtitle>
<%= if @current_scope do %>
You need to reauthenticate to perform sensitive actions on your account.
<% else %>
Don't have an account? <.link
navigate={~p"/users/register"}
class="font-semibold text-primary hover:underline"
phx-no-format
>Sign up</.link> for an account now.
<% end %>
</:subtitle>
</.header>
</div>
<.form :let={f} for={@form} as={:user} id="login_form_password" action={~p"/users/log-in"}>
<.input
readonly={!!@current_scope}
field={f[:email]}
type="email"
label="Email"
autocomplete="username"
spellcheck="false"
required
phx-mounted={JS.focus()}
/>
<.input
field={f[:password]}
type="password"
label="Password"
autocomplete="current-password"
spellcheck="false"
required
/>
<.input
field={f[:remember_me]}
type="checkbox"
label="Keep me logged in"
/>
<.button class="btn btn-primary w-full" phx-disable-with="Logging in...">
Log in <span aria-hidden="true">&rarr;</span>
</.button>
</.form>
<p class="text-center text-sm text-base-content/70">
<.link
navigate={~p"/users/reset-password"}
class="font-semibold text-primary hover:underline"
>
Forgot your password?
</.link>
</p>
</div>
</Layouts.app>