function setUserData() {
    fetch('/current_user')
        .then(response => response.json())
        .then(data => {
            if (data.username) {
                document.getElementById('User-name').textContent = "" + data.username;
            }
            if (data.company_name) {
                document.querySelector('.company-dashboard-title').textContent = "" + data.company_name;
            }
        })
        .catch(error => {
            console.error('Error:', error);
        });
}
setUserData();