Sessions

Manage your active sessions and connected applications.

Connected Applications

These applications have access to your account. You can revoke access at any time.

<% if @connected_applications.any? %>
    <% @connected_applications.each do |consent| %>
  • <%= consent.application.name %>

    Access to: <%= consent.formatted_scopes %>

    Authorized <%= time_ago_in_words(consent.granted_at) %> ago

    <%= button_to "Revoke Access", revoke_consent_active_sessions_path(application_id: consent.application.id), method: :delete, class: "inline-flex items-center rounded-md border border-red-300 bg-white px-3 py-2 text-sm font-medium text-red-700 shadow-sm hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2", form: { data: { turbo_confirm: "Are you sure you want to revoke access to #{consent.application.name}? You'll need to re-authorize this application to use it again." } } %>
  • <% end %>
<% else %>

No connected applications.

<% end %> <% if @connected_applications.any? %>
<%= button_to "Revoke All App Access", revoke_all_consents_active_sessions_path, method: :delete, class: "inline-flex items-center rounded-md border border-red-300 bg-white px-3 py-2 text-sm font-medium text-red-700 shadow-sm hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 whitespace-nowrap", form: { data: { turbo_confirm: "This will revoke access from all connected applications. You'll need to re-authorize each application to use them again. Are you sure?" } } %>
<% end %>

Active Sessions

These devices are currently signed in to your account. Revoke any sessions that you don't recognize.

<% if @active_sessions.any? %>
    <% @active_sessions.each do |session| %>
  • <%= session.device_name || "Unknown Device" %> <% if session.id == Current.session.id %> This device <% end %>

    <%= session.ip_address %>

    Last active <%= time_ago_in_words(session.last_activity_at || session.updated_at) %> ago

    <% if session.id != Current.session.id %> <%= button_to "Revoke", session_path(session), method: :delete, class: "inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2", form: { data: { turbo_confirm: "Are you sure you want to revoke this session?" } } %> <% end %>
  • <% end %>
<% else %>

No other active sessions.

<% end %> <% if @active_sessions.count > 1 %>
<%= button_to "Sign Out Everywhere Else", session_path(Current.session), method: :delete, class: "inline-flex items-center rounded-md border border-orange-300 bg-white px-3 py-2 text-sm font-medium text-orange-700 shadow-sm hover:bg-orange-50 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-offset-2 whitespace-nowrap", form: { data: { turbo_confirm: "This will sign you out from all other devices except this one. Are you sure?" } } %>
<% end %>