Get user information in localstorage

I want the information to be stored individually in localStorage.
If the entered information is already available, do not receive the information again and give an alert. Is it possible to guide me, what should I do?

function handleSubmit(e) {
  e.preventDefault()
  let users = JSON.parse(localStorage.getItem("users") || "[]")
  users.push(values)
        
  localStorage.setItem('users', JSON.stringify(users))
        
  const loggeduser = JSON.parse(localStorage.getItem("users") || "[]");
  if (
    values.email === loggeduser.email &&
    values.password === loggeduser.password
  ) {
    alert("Emaill & Password is available!!!")
  } else {
    navigate("/");
  }
};

Several users are stored in one presentation and not separately.
The alert also works incorrectly.