chore: закоммичены все рабочие файлы smeta-web
Предотвращение потери данных при деплое: batch_v3, search_engine, xlsx_utils, тесты, скрипты деплоя, архитектура, security page, admin page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,13 @@ const token = localStorage.getItem('token');
|
||||
if (!token) window.location.href = '/';
|
||||
const H = {'Authorization': 'Bearer ' + token};
|
||||
|
||||
// Check token validity — redirect to login on 401
|
||||
async function checkAuth() {
|
||||
const r = await fetch('/api/admin/stats', {headers: H});
|
||||
if (r.status === 401) { localStorage.removeItem('token'); window.location.href = '/'; }
|
||||
}
|
||||
checkAuth();
|
||||
|
||||
// Navigation
|
||||
function showPage(name) {
|
||||
document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
|
||||
|
||||
Reference in New Issue
Block a user