mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- Admin -> About: Email card (delivery, server, encryption, login name, From; never the password) and a "Send test email" button that sends immediately and shows the SMTP error if it fails - SMTP: implicit TLS on port 465 (or SMTP_TLS=true), auth only with a username, 10-15 s timeouts - "Email me a sign-in link": single-use (spent by any later sign-in via a monotonic users.last_signed_in_at), 15-minute expiry, confirm step so mail scanners can't use it up, same answer for unknown addresses, rate limited, off when PASSWORD_LOGIN=false - Admin -> Users shows last sign-in Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.5 KiB
ERB
26 lines
1.5 KiB
ERB
<% content_for :title, "Sign in" %>
|
|
<div class="mx-auto max-w-sm">
|
|
<h1 class="mb-4 text-2xl font-bold">Sign in</h1>
|
|
<div class="card card-body space-y-4">
|
|
<% if Sso.enabled? %>
|
|
<%= button_to "Sign in with #{Sso.label}", "/auth/#{Sso::PROVIDER}", class: "btn-primary w-full justify-center", data: { turbo: false } %>
|
|
<% end %>
|
|
<% if Sso.password_login? %>
|
|
<% if Sso.enabled? %>
|
|
<div class="flex items-center gap-3 text-xs text-slate-400"><span class="h-px flex-1 bg-slate-200"></span>or<span class="h-px flex-1 bg-slate-200"></span></div>
|
|
<% end %>
|
|
<%= form_with url: session_path, class: "space-y-4" do |form| %>
|
|
<div><%= form.label :email_address, "Email", class: "label" %>
|
|
<%= form.email_field :email_address, required: true, autofocus: !Sso.enabled?, autocomplete: "username", value: params[:email_address], class: "input" %></div>
|
|
<div><%= form.label :password, class: "label" %>
|
|
<%= form.password_field :password, required: true, autocomplete: "current-password", maxlength: 72, class: "input" %></div>
|
|
<%= form.submit "Sign in", class: (Sso.enabled? ? "btn-secondary" : "btn-primary") + " w-full justify-center" %>
|
|
<p class="flex flex-wrap justify-center gap-x-4 gap-y-1 text-sm">
|
|
<% if MailSettings.configured? %><%= link_to "Email me a sign-in link", new_sign_in_link_path, class: "link" %><% end %>
|
|
<%= link_to "Forgot password?", new_password_path, class: "link" %>
|
|
</p>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|