text: const loginFormHandler = async (event) => {
   
      event.preventDefault();
    
      const email = document.querySelector('#username').value.trim();
      const password = document.querySelector('#password').value.trim();
    
      if (email && password) {
    
        const response = await fetch('/api/users/login', {
          method: 'POST',
          body: JSON.stringify({ email, password }),
          headers: { 'Content-Type': 'application/json' },
        });
    
        if (response.ok) {
          console.log('working')
          window.location.replace('/');
        } else {
          alert('Failed to log in');
        }
      }
    };
    
    document
      .querySelector('.login-form')
      .addEventListener('submit', loginFormHandler);