kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 193 forks source link

please i how i can test user status before rendring #662

Open neutron92 opened 8 years ago

neutron92 commented 8 years ago

please i how i can test user status before rendring i know how it work for iron router it was like this:

Router.onBeforeAction(function() {

    if (!Meteor.userId() && !Meteor.loggingIn()) {
        // if the user is not logged in, render the Login template
        Router.go('login');
    } else {
        // otherwise don't hold up the rest of hooks or our route/action function
        // from running
        this.next();
    }
}, {
    except: ['login', 'notFound', 'loading', 'register']
});

Please how to do it in Flow router