Your Profile

<%= form_with model: @user, url: profile_path, method: :patch, 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" %> <%= f.field :password, as: :password, label: "New password", hint: "Leave blank to keep your current password.", autocomplete: "new-password" %> <%= f.field :password_confirmation, as: :password, label: "Confirm new password", autocomplete: "new-password" %>
<%= label_tag "user[current_password]", "Current password", class: "label" %> <%= password_field_tag "user[current_password]", nil, id: "user_current_password", class: "input", autocomplete: "current-password" %>

Needed to change your email or password.<%= " Signed up with #{Sso.label} and never set one? Use “Forgot password?” on the sign-in page." if Sso.enabled? && @user.sso_uid? %>

<%= f.submit "Save" %> <% end %> <% if Sso.enabled? %>

Single sign-on

<% if @user.sso_uid? %>

Your account is linked to <%= Sso.label %>; you can sign in with it.

<% if Sso.password_login? %>
<%= button_to "Unlink #{Sso.label}", sso_link_path, method: :delete, class: "btn-secondary btn-sm", form: { data: { turbo_confirm: "Unlink #{Sso.label}? You'll sign in with your email and password." } } %>
<% end %> <% else %>

Link your <%= Sso.label %> account to sign in with it.

<%= button_to "Link #{Sso.label}", "/auth/#{Sso::PROVIDER}", class: "btn-secondary btn-sm", data: { turbo: false } %>
<% end %>
<% end %>

Sessions

<% others = @user.sessions.where.not(id: Current.session.id).count %>

You're signed in on <%= pluralize(others, "other device or browser", plural: "other devices or browsers") %>. Sessions unused for <%= Authentication::SESSION_IDLE_TIMEOUT.inspect %> sign out on their own.

<% if others.positive? %>
<%= button_to "Sign out everywhere else", other_sessions_path, method: :delete, class: "btn-secondary btn-sm" %>
<% end %>

Integrations

<%= link_to "AirTrail sync", air_trail_connection_path, class: "link" %>: <%= current_user.air_trail_connection&.enabled? ? "on" : "off" %>. Push the flights you log to your AirTrail flight map automatically.