From 94d6690e5796f461acff488e53a904117fc4424c Mon Sep 17 00:00:00 2001 From: Steve Dogiakos Date: Tue, 10 Mar 2026 10:39:10 -0600 Subject: [PATCH] fix: add logout button to admin pages --- app.py | 9 +++++++++ templates/admin.html | 1 + templates/admin_users.html | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index ed56a24..3d2567a 100644 --- a/app.py +++ b/app.py @@ -284,6 +284,15 @@ def admin_delete(entry_id): logger.error("Database error deleting guest %d: %s", entry_id, e) return redirect(url_for('admin', page=request.args.get('page', 1))) +@app.route('/admin/logout') +def admin_logout(): + return Response( + '

You have been logged out. ' + 'Log in again

', + 401, + {'WWW-Authenticate': 'Basic realm="Admin"', 'Content-Type': 'text/html'} + ) + @app.route('/admin/users') @require_superadmin def admin_users(): diff --git a/templates/admin.html b/templates/admin.html index c3714de..3b77686 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -15,6 +15,7 @@ {% if current_role == 'superadmin' %} Manage Users {% endif %} + Logout diff --git a/templates/admin_users.html b/templates/admin_users.html index 9689cd6..6f1a88a 100644 --- a/templates/admin_users.html +++ b/templates/admin_users.html @@ -10,7 +10,10 @@

User Management

- Back to Entries +