The code I use in conjunction with RT-QUERY.
It seems to work, but I'm not sure if I'm using the event correctly.
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
onIdTokenChanged(auth, (user) => { // обновление токена
console.log(user);
if (user) {
console.log(user);
getIdToken(user, true).then(r => {
console.log(r);
return ls.set('token', r);
});
}
return null;
});