[refactor](trx-frontend-http): consolidate to single auth interface
Remove duplicate logout button from About tab. Use only the header Login/Logout button for unified authentication control. The About tab now shows the authentication badge (when logged in) without the redundant logout button. Single login view: - Auth gate with Login form + Continue as Guest button (when no rx pass) - Header Login/Logout button for quick access - Auth badge in About tab showing current role Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -90,13 +90,11 @@ function showAuthError(msg) {
|
||||
}
|
||||
|
||||
function updateAuthUI() {
|
||||
const btn = document.getElementById("logout-btn");
|
||||
const badge = document.getElementById("auth-badge");
|
||||
const badgeRole = document.getElementById("auth-role-badge");
|
||||
const headerAuthBtn = document.getElementById("header-auth-btn");
|
||||
|
||||
if (authRole) {
|
||||
btn.style.display = "block";
|
||||
badge.style.display = "block";
|
||||
badgeRole.textContent = authRole === "control" ? "Control (full access)" : "RX (read-only)";
|
||||
if (headerAuthBtn) {
|
||||
@@ -104,7 +102,6 @@ function updateAuthUI() {
|
||||
headerAuthBtn.style.display = "block";
|
||||
}
|
||||
} else {
|
||||
btn.style.display = "none";
|
||||
badge.style.display = "none";
|
||||
if (headerAuthBtn) {
|
||||
headerAuthBtn.textContent = "Login";
|
||||
@@ -1276,13 +1273,6 @@ if (guestBtn) {
|
||||
});
|
||||
}
|
||||
|
||||
// Setup logout button
|
||||
document.getElementById("logout-btn").addEventListener("click", async () => {
|
||||
if (confirm("Are you sure you want to logout?")) {
|
||||
await authLogout();
|
||||
}
|
||||
});
|
||||
|
||||
// Setup header auth button (Login/Logout)
|
||||
const headerAuthBtn = document.getElementById("header-auth-btn");
|
||||
if (headerAuthBtn) {
|
||||
|
||||
Reference in New Issue
Block a user