meteor-useraccounts / flow-routing

Useraccounts packages add-on for integration with Flow Router and Blaze Layout.
https://atmospherejs.com/useraccounts/flow-routing
MIT License
72 stars 50 forks source link

Ensure sign in exception #9

Closed rafaelcorreiapoli closed 9 years ago

rafaelcorreiapoli commented 9 years ago

Hi! I have all my routes protected with this FlowRouter.triggers.enter([AccountsTemplates.ensureSignedIn]);

But how can i make an exception? I want to make the path /freeforall not protected How can I do this ?

jshimko commented 9 years ago
// assuming the route name is "freeforall"
FlowRouter.triggers.enter([AccountsTemplates.ensureSignedIn], { except: ["freeforall"] });

https://github.com/kadirahq/flow-router/#defining-triggers-globally

rafaelcorreiapoli commented 9 years ago

Nice! thanks! is there a way to define an exception for an entire group ?

jshimko commented 9 years ago

https://github.com/kadirahq/flow-router/#group-routes

jshimko commented 9 years ago

Using their example...

var adminRoutes = FlowRouter.group({
  prefix: '/admin',
  name: 'admin',
  triggersEnter: [AccountsTemplates.ensureSignedIn]
});
splendido commented 9 years ago

@shactdeveloper, is this solved?

rafaelcorreiapoli commented 9 years ago

Yes, thank you so much my friends!

splendido commented 9 years ago

you're welcome!