fix: regex percorsi editor senza bypass prefisso

This commit is contained in:
2026-07-05 15:36:38 +02:00
parent 77041f9d5a
commit 274a6c7600
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ export function logout(db: Database.Database, token: string): void {
}
// Percorsi admin consentiti anche al ruolo editor.
const EDITOR_ALLOWED = [/^\/admin\/content(\/|$)?/, /^\/api\/admin\/content(\/|$)/, /^\/admin\/logout$/];
const EDITOR_ALLOWED = [/^\/admin\/content(\/|$)/, /^\/api\/admin\/content(\/|$)/, /^\/admin\/logout$/];
export function canAccessAdminPath(role: string, pathname: string): boolean {
if (role === 'admin') return true;