Welcome, <%= @user.email_address %>

<% if @user.admin? %> Administrator <% else %> User <% end %>

Active Sessions
<%= @user.sessions.active.count %>
<%= link_to "View all sessions", profile_path, class: "text-sm font-medium text-blue-600 hover:text-blue-500" %>
<% if @user.totp_enabled? %>
Two-Factor Authentication
Enabled
<%= link_to "Manage 2FA", profile_path, class: "text-sm font-medium text-blue-600 hover:text-blue-500" %>
<% else %>
Two-Factor Authentication
Not Enabled
<%= link_to "Enable 2FA", profile_path, class: "text-sm font-medium text-blue-600 hover:text-blue-500" %>
<% end %>

Your Applications

<% if @applications.any? %>
<% @applications.each do |app| %>
<% if app.icon.attached? %> <%= image_tag app.icon, class: "h-12 w-12 rounded-lg object-cover border border-gray-200 shrink-0", alt: "#{app.name} icon" %> <% else %>
<% end %>

<%= app.name %>

<%= app.app_type.humanize %>
<% if app.description.present? %>

<%= app.description %>

<% end %>
<% if app.landing_url.present? %> <%= link_to "Open Application", app.landing_url, target: "_blank", rel: "noopener noreferrer", class: "w-full flex justify-center items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition" %> <% else %>
No landing URL configured
<% end %> <% if app.user_has_active_session?(@user) %> <%= button_to "Logout", logout_from_app_active_sessions_path(application_id: app.id), method: :delete, class: "w-full flex justify-center items-center px-4 py-2 border border-orange-300 text-sm font-medium rounded-md text-orange-700 bg-white hover:bg-orange-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 transition", form: { data: { turbo_confirm: "This will log you out of #{app.name}. You can sign back in without re-authorizing. Continue?" } } %> <% end %>
<% end %>
<% else %>

No applications available

You don't have access to any applications yet. Contact your administrator if you think this is an error.

<% end %>
<% if @user.admin? %>

Admin Quick Actions

<%= link_to admin_users_path, class: "block p-6 bg-white rounded-lg border border-gray-200 shadow-sm hover:bg-gray-50 hover:shadow-md transition" do %>

Manage Users

View, edit, and invite users

<% end %> <%= link_to admin_applications_path, class: "block p-6 bg-white rounded-lg border border-gray-200 shadow-sm hover:bg-gray-50 hover:shadow-md transition" do %>

Manage Applications

Register and configure applications

<% end %> <%= link_to admin_groups_path, class: "block p-6 bg-white rounded-lg border border-gray-200 shadow-sm hover:bg-gray-50 hover:shadow-md transition" do %>

Manage Groups

Create and organize user groups

<% end %>
<% end %>