-1👍
I changed routeguard to watch for auth initialization and then check for currentUser.
router.beforeEach((to, from, next) => {
auth.onAuthStateChanged(function(user) {
const requiresAuth = to.matched.some(record => record.meta.requiresAuth);
if (!requiresAuth) {
next()
} else if (requiresAuth && user) {
next()
} else {
next("/signin");
}
});
});
Source:stackexchange.com