const token = localStorage.getItem('token'); if (!token) { alert('Please login to continue.'); window.location.href = '/static/login.html'; }