The Core's admin account is always an admin of the app

Every app's .env gets CORE_ADMIN_EMAIL (admin@<domain>, the Core's own
admin, as Federated's apps use). The skill says apps make that account an
admin on each Core sign-in, trusting only Authelia's email, instead of a
setup link; the sso example apps show the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 18:34:36 -07:00
co-authored by Claude Opus 5.5
parent da36a669bf
commit dca8837487
8 changed files with 54 additions and 13 deletions
+2 -1
View File
@@ -88,9 +88,10 @@ class Handler(BaseHTTPRequestHandler):
"SELECT count(*) FROM visits WHERE person = %s", (user["sub"],)
).fetchone()[0]
people = db.execute("SELECT count(DISTINCT person) FROM visits").fetchone()[0]
admin = ", the app's admin" if user.get("admin") else ""
self.page(
f"<p>Signed in as <strong id=\"user\">{html.escape(user['name'])}</strong>"
f" ({html.escape(user['email'])}).</p>"
f" ({html.escape(user['email'])}){admin}.</p>"
f"<p>Your visits: <strong id=\"visits\">{mine}</strong>"
f" (people who have visited: {people}), counted in PostgreSQL.</p>"
'<p><a href="/logout">Sign out</a></p>'