I'm fairly new to node and making a web-app in which I use passport to authenticate and then store the user using firebase authentication by a custom token.

and now i want to perform a lookup and check if the user is registered with my app.

So is there is a way to check for a specific user (like either by their uid or email)? 

in the docs [here](https://firebase.google.com/docs/auth/admin/manage-users) it is given how to list all the users. 

here is the code for it (i modified a bit for my purpose) -

```
function listAllUsers(id, nextPageToken) { // passing an id to check and page token is not passed as default
  // List batch of users, 1000 at a time.
  admin.auth().listUsers(1000, nextPageToken)
    .then(function(listUsersResult) {
      listUsersResult.users.forEach(function(userRecord) {
        if (userRecord.uid == id){
              return true // here i return from the function but it only return from one function. (do i have to make a flag to come out from all of them?)
            }
      });
      if (listUsersResult.pageToken) {
        // List next batch of users.
        listAllUsers(id, listUsersResult.pageToken)
      }
    })
    .catch(function(error) {
      console.log("Error listing users:", error);
    });
}
// Start listing users from the beginning, 1000 at a time.
let user = listAllUsers('some random id'); // i expect a Boolean here

```

but is there any way to do a lookup like `listUsersResult.users.find(id) // which may return a boolean or whole user?`