mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
- 10 failed sign-ins in a row (password, authenticator code, or password at signing) lock an account for 15 minutes from any address; the user is emailed; admins can unlock. Same message as a wrong password. - Passwords: at least 12 characters (max 72), refused if found in Have I Been Pwned (k-anonymity range API; fails open; PWNED_PASSWORDS_CHECK=false) - Optional TOTP (authenticator app) with 10 recovery codes for password and emailed-link sign-in, and at signing (auth method password_totp); codes accepted once; admins can reset; SSO sign-in unaffected - Demo/test passwords updated; guide, README and procedures document Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
1.8 KiB
ERB
20 lines
1.8 KiB
ERB
<% content_for :title, "Sign a logbook entry" %>
|
|
<div class="mx-auto max-w-md space-y-4">
|
|
<h1 class="text-2xl font-bold">Sign a logbook entry</h1>
|
|
<p class="text-sm text-slate-600">You've been asked to sign the <%= @entry.date %> <%= LogbookEntry::LOG_TYPES[@entry.log_type].downcase %> log entry for <%= @entry.aircraft.tail_number %>. First, sign in as <strong><%= @invitation.email %></strong>.</p>
|
|
<div class="card card-body space-y-3">
|
|
<%= link_to "I have an account: sign in", new_session_path, class: "btn-primary w-full justify-center" %>
|
|
</div>
|
|
<% if Sso.password_login? && !User.exists?(email_address: @invitation.email) %>
|
|
<%= form_with url: account_invited_signing_path(params[:token]), class: "card card-body space-y-3" do %>
|
|
<h2 class="card-title">Or create an account</h2>
|
|
<% if @account_errors.present? %><div class="rounded-md bg-red-50 p-2 text-sm text-red-700"><%= @account_errors.to_sentence %></div><% end %>
|
|
<div><label class="label">Email</label><input class="input" value="<%= @invitation.email %>" disabled></div>
|
|
<div><%= label_tag :name, "Your name", class: "label" %><%= text_field_tag :name, params[:name], class: "input", required: true %></div>
|
|
<div><%= label_tag :password, "Password", class: "label" %><%= password_field_tag :password, nil, class: "input", required: true, autocomplete: "new-password", minlength: User::PASSWORD_MIN, maxlength: 72 %><p class="hint">At least <%= User::PASSWORD_MIN %> characters; not one known from a data breach.</p></div>
|
|
<div><%= label_tag :password_confirmation, "Confirm password", class: "label" %><%= password_field_tag :password_confirmation, nil, class: "input", required: true, autocomplete: "new-password" %></div>
|
|
<%= submit_tag "Create account", class: "btn-secondary" %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|