Meteor account disconnected while page refresh in accounts-ui package. I am checking Meteor.userId() on Flow routing.
appRoute.route(’/setting’, {
name: ‘setting’,
triggersEnter: [function(context, redirect) {
console.log(">>> “,Meteor.user()) //it returns undefined after page refresh
if(!Meteor.user()){
console.log(”===")
redirect(‘home’);
}
}],
action() {
mount(Home, {
main: ,
});
}
});
ralof
August 26, 2016, 1:21pm
2
It takes a while to log in the user after a hard page load, you can check it with:
if (Meteor.loggingIn()) {
this.render('loading');
}
else
Meteor.loggingIn() returns false and not working with it.
ralof
August 26, 2016, 1:57pm
4
You mean Meteor.loggingIn() returns false and Meteor.user() is undefined at the same time?
If you, after that, type Meteor.user() in the console and get a user object, something is wrong…