From 405cb54240f0963fb71c7af61b5650a33e1dc14d Mon Sep 17 00:00:00 2001 From: Jared Wolff Date: Thu, 5 Mar 2026 17:02:43 -0500 Subject: [PATCH] fix(profile): show active/revoked status for app passwords Add Status column to app passwords table with Active/Revoked badge. Only show the revoke button for active passwords. --- static/js/views/profile/profile.js | 26 +++++++++++++++++++------- static/profile.html | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/static/js/views/profile/profile.js b/static/js/views/profile/profile.js index 5039816b..a4f2faec 100755 --- a/static/js/views/profile/profile.js +++ b/static/js/views/profile/profile.js @@ -152,14 +152,26 @@ function renderPwRow(pw) { created.textContent = new Date(pw.created_at).toLocaleDateString(); const lastUsed = document.createElement('td'); lastUsed.textContent = pw.last_used_at ? timeAgo(pw.last_used_at) : 'Never'; + const status = document.createElement('td'); + const badge = document.createElement('span'); + if (pw.active !== false) { + badge.className = 'badge badge-active'; + badge.textContent = 'Active'; + } else { + badge.className = 'badge badge-expired'; + badge.textContent = 'Revoked'; + } + status.appendChild(badge); const actions = document.createElement('td'); - const btn = document.createElement('button'); - btn.className = 'btn btn-danger-sm'; - btn.innerHTML = ''; - btn.title = 'Revoke'; - btn.addEventListener('click', function () { revokeAppPassword(pw.id, pw.label); }); - actions.appendChild(btn); - tr.append(label, created, lastUsed, actions); + if (pw.active !== false) { + const btn = document.createElement('button'); + btn.className = 'btn btn-danger-sm'; + btn.innerHTML = ''; + btn.title = 'Revoke'; + btn.addEventListener('click', function () { revokeAppPassword(pw.id, pw.label); }); + actions.appendChild(btn); + } + tr.append(label, created, lastUsed, status, actions); return tr; } diff --git a/static/profile.html b/static/profile.html index 30f58e33..10cbd43d 100755 --- a/static/profile.html +++ b/static/profile.html @@ -116,7 +116,7 @@ - +
LabelCreatedLast Used
LabelCreatedLast UsedStatus