I have a question, hopefully you can guide me, I am integrating an Angular application and a Node.js API, in both we use Firestore (firebase) we are integrating an Angular request (client) to an api rest (Node.js) when validating the tokens of the authenticated user (firebase) we have a problem since the token never expires, we do not know why it does not expire, although we log out in the Angular application it always returns as a valid token in Node.js.
From the client (Angular) we are using this code to send the token to the API (Node.js)
firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) {
// Send token to your backend via HTTPS
// ...
}).catch(function(error) {
// Handle error
});
The validation from the Rest API is like this:
// idToken comes from the client app
admin.auth().verifyIdToken(idToken)
.then(function(decodedToken) {
let uid = decodedToken.uid;
// ...
}).catch(function(error) {
// Handle error
});
The problem is that the token never expires, since Node.js always tells me that the token is valid, how should it validate if the user is still active?