Closed MHerszak closed 8 years ago
I'm bumping into this same error, in the same context:
// Set group using previous re-direct
const authenticatedRoutes = FlowRouter.group({
name: 'authenticated',
triggersEnter: [function(context, redirect) {
// Redirect unauthed users to login page
if (!Meteor.loggingIn() && !Meteor.userId()) {
console.log('not authorized');
redirect('/login');
}
}]
});
The log statement is firing without issue. If I replace the redirect with FlowRouter.go
, I get the same issue described by @MHerszak
quick followup—reverting to current stable version of flow-router (not -ssr) corrects this issue. I'm currently using Meteor 1.3-beta.12.
This is fixed thanks to @marbemac's PR. Update the package.
I am using 'kadira:flow-router-ssr@3.11.2' and neither redirect nor FlowRouter.go seem to work. I am trying to trigger after an evaluation. "redirect" throws Uncaught TypeError: str.slice is not a function and FlowRouter.go only changes the route for a second and changes it back to the route I just evaluated against. I expected to be redirected, actually.
I attached a screenshot from the browser tools and it seems there is a serious problem with "redirect". The string prototype is actually not a string, its a function. Any idea?
Redirect seems to throw an error when I access a route
triggersEnter: [function(context, redirect) { redirect('/posts/list'); }],