mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
New accounts only from an administrator or an administrator's invitation
Anyone can add an aircraft and so manage its people, so invitations from non-administrators could bring in new accounts without an administrator. - An invitation makes a new account only if whoever made it is still an administrator when it's used; an aircraft's Access page invitations are for people who already have an account (its welcome page says so). - Signing invitations no longer make accounts: the mechanic needs one first, and the owner is told when they don't have one. - With SSO, "Continue with <provider>" on an administrator's invitation makes the account and accepts the invitation (only for its address when it has one), so invitations work without OIDC_AUTO_CREATE_USERS. That setting stays, documented as giving accounts without an invitation; the Authentik example now leaves it off. - Docs: who makes accounts (guide, README, Authentik, .env.example, API). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b4c7aaa3ff
commit
19bc3efa19
19 files changed
+159
-85
No files matched your search
@@ -5,15 +5,7 @@
|
||||
<div class="card card-body space-y-3">
|
||||
<%= link_to t(".i_have_an_account_sign"), 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"><%= t(".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"><%= t(".email") %></label><input class="input" value="<%= @invitation.email %>" disabled></div>
|
||||
<div><%= label_tag :name, t(".your_name"), class: "label" %><%= text_field_tag :name, params[:name], class: "input", required: true %></div>
|
||||
<div><%= label_tag :password, t(".password"), class: "label" %><%= password_field_tag :password, nil, class: "input", required: true, autocomplete: "new-password", minlength: User::PASSWORD_MIN, maxlength: 72 %><p class="hint"><%= t(".at_least_characters_not_one_html", min: (User::PASSWORD_MIN)) %></p></div>
|
||||
<div><%= label_tag :password_confirmation, t(".confirm_password"), class: "label" %><%= password_field_tag :password_confirmation, nil, class: "input", required: true, autocomplete: "new-password" %></div>
|
||||
<%= submit_tag t(".create_account"), class: "btn-secondary" %>
|
||||
<% end %>
|
||||
<% unless User.exists?(email_address: @invitation.email) %>
|
||||
<p class="text-sm text-slate-600"><%= t(".no_account_yet", email: @invitation.email) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -6,10 +6,15 @@
|
||||
<%= render "joins/grants", invitation: @invitation %>
|
||||
</div>
|
||||
<div class="card card-body space-y-3">
|
||||
<%= link_to t(".i_have_an_account"), new_session_path, class: "btn-primary w-full justify-center" %>
|
||||
<% if Sso.enabled? && @invitation.creates_accounts? %>
|
||||
<%= button_to t(".continue_with", provider: Sso.label), "/auth/#{Sso::PROVIDER}", class: "btn-primary w-full justify-center", data: { turbo: false } %>
|
||||
<p class="hint"><%= t(".sso_hint", provider: Sso.label) %></p>
|
||||
<% end %>
|
||||
<%= link_to t(".i_have_an_account"), new_session_path, class: [ "w-full justify-center", (Sso.enabled? && @invitation.creates_accounts? ? "btn-secondary" : "btn-primary") ] %>
|
||||
<% if @invitation.email %><p class="hint"><%= t(".for_email", email: @invitation.email) %></p><% end %>
|
||||
<% unless @invitation.creates_accounts? %><p class="hint"><%= t(".existing_accounts_only") %></p><% end %>
|
||||
</div>
|
||||
<% if Sso.password_login? && !(@invitation.email && User.exists?(email_address: @invitation.email)) %>
|
||||
<% if @invitation.creates_accounts? && Sso.password_login? && !(@invitation.email && User.exists?(email_address: @invitation.email)) %>
|
||||
<%= form_with url: account_join_path(params[:token]), class: "card card-body space-y-3" do %>
|
||||
<h2 class="card-title"><%= t(".or_create_an_account") %></h2>
|
||||
<% if @account_errors.present? %><div class="rounded-md bg-red-50 p-2 text-sm text-red-700" role="alert"><%= @account_errors.to_sentence %></div><% end %>
|
||||
|
||||
Reference in new issue
Block a user