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>
11 lines
888 B
ERB
11 lines
888 B
ERB
<%= form_with model: [:admin, user], class: "card card-body space-y-4 max-w-md" do |f| %>
|
|
<%= f.errors_summary %>
|
|
<%= f.field :name %>
|
|
<%= f.field :email_address, as: :email, label: "Email", required: true %>
|
|
<%= f.field :password, as: :password, hint: (user.persisted? ? "Leave blank to keep current password." : "At least #{User::PASSWORD_MIN} characters; not one known from a data breach."), autocomplete: "new-password" %>
|
|
<%= f.field :password_confirmation, as: :password %>
|
|
<%= f.field :admin, as: :checkbox, label: "Administrator", hint: "Admins can see and edit every aircraft and manage users." %>
|
|
<div class="flex gap-2"><%= f.submit "Save" %><%= link_to "Cancel", admin_users_path, class: "btn-secondary" %></div>
|
|
<% end %>
|
|
<% if user.persisted? && user != current_user %><div class="mt-4"><%= delete_button "Delete user", admin_user_path(user) %></div><% end %>
|