[FIX] Knowledge Base: token key errata (access_token->nis2_access_token) + init mancante

Bug CRITICO da test multi-agente: kb.js::getJwt() leggeva localStorage 'access_token'
ma l'app salva il JWT sotto 'nis2_access_token' -> ogni chiamata KB inviava
Authorization: Bearer (vuoto) -> 401 -> pagina KB completamente inutilizzabile
(upload/list/search/delete). Stesso pattern del bug this.delete.
Inoltre kb.html non aveva il blocco init (checkAuth/loadSidebar/I18n.init) presente
in tutte le altre pagine -> sidebar vuota e nessun redirect a login.

Fix: kb.js usa nis2_access_token; kb.html aggiunge i18n.js + init auth/chrome.
node --check OK. version 1.10.6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
DevEnv nis2-agile
2026-05-31 15:11:37 +02:00
co-authored by Claude Opus 4.8
parent 4ab549fc0c
commit 8a55194b2f
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
function getJwt() {
try {
return localStorage.getItem('access_token') || sessionStorage.getItem('access_token') || '';
return localStorage.getItem('nis2_access_token') || sessionStorage.getItem('nis2_access_token') || '';
} catch (e) { return ''; }
}