text: const logout = async () => {
      const response = await fetch('/api/user/logout', {
        method: 'GET',
        headers: { 'Content-Type': 'application/json' },
      });
    
      if (response.ok) {
        document.location.replace('/');
      } else {
        alert('Failed to log out.');
      }
    };
    
    document.querySelector('#logout').addEventListener('click', logout);
    