Let's explain what just happened:
- What we want is to find all the users within our application, that's the mission of the getUsers() function. This function will use the internal Google API to retrieve the users. The getAccessToken function is quite explicit; it will get us the access token from Google's application metadata that we can use to access the Google API servers. Over that call, we're specifying the retrieval of the users localId and lastLoginAt.
- Within the main function call, we're filtering the users based on their lastLoginAt field to one week, and simply returning a list that suits those parameters.
- After that, we're using the Firebase Admin SDK to find the user metadata based on their localId so we can get ...