<%= 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.