Indexing firebase data to algolia when in firebase rules auth != null

The code above is working when authentication is disabled. how to tweak this code to add authentication.

Unfortunately this is outside the realm of Algolia, I would take a look at Firebase’s docs and see how to lock this down since Algolia doesn’t mind if you are authenticated or not to do the search it would be more than likely handled on Firebase’s end.