last update
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-07-14 20:10:38 +02:00
parent cc6db94977
commit 1a7b3397f6
14 changed files with 847 additions and 146 deletions
+17
View File
@@ -297,6 +297,23 @@ export async function isAdminAuthenticated(): Promise<boolean> {
return verifyToken(token);
}
/**
* This project has no user accounts or roles table — there is a single
* privileged session: the authenticated admin cookie checked above. There is
* no separate "regular user" tier, so an authenticated admin session is by
* definition the only "Super Admin". This is a readable alias only, kept as
* a thin wrapper around `isAdminAuthenticated()` (not a new auth mechanism).
*
* Security note: this function (and any UI it gates, like the header's admin
* shortcut button) is NOT the access-control boundary. Every admin page and
* server action must independently guard itself with `requireAdminAuth()` or
* an equivalent inline `isAdminAuthenticated()` check — never rely on a link
* being hidden as the thing that keeps the admin area protected.
*/
export async function isSuperAdmin(): Promise<boolean> {
return isAdminAuthenticated();
}
/**
* Call at the top of every authenticated admin page or server action.
* Clears the session cookie and redirects to the login page if not authenticated.