I'm developing a Flutter app using Firebase Auth and for the backend AdonisJS, I already created the sign up/sign in methods, the problem/dude that I have is that the firebase auth token expires after 1 hour and I don't know the correct way to get the new token to send it to the backend to know if the user it authorized to the REST API.
I know I can get the new token with
await _firebaseAuth.currentUser.getIdToken()
But how should I check if the token expired and if so, how to ask for the new one? Is there something like a daemon to check it every time I'm going to consume my REST API
Your help is really appreciated, I'm pretty new to Firebase and Flutter