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

Provide example using new Meteor imports directory structure #43

Closed tab00 closed 6 years ago

tab00 commented 8 years ago

I'm having some trouble getting useraccounts to work with the new imports directory structure as described in Application Structure.

I've looked at the todos example app, however that app overrides the built-in templates. When I remove the importation of the custom templates, no Sign In form appears. Maybe I need to explicitly import the default built-in templates, but I don't know what to write.

So currently there is no example code that shows how useraccounts, with its built-in templates, can be implemented in Meteor 1.3 with modules.

Please update the boilerplate code to the latest Meteor version and refactor the code to use modules and associated import statements.

Thank you.

tab00 commented 8 years ago

I solved my problems (caused by a last-resort "catch-all" route) so I don't need an example anymore. But you should probably update the boilerplates anyway to keep up with Meteor.

lyricalpolymath commented 8 years ago

@tab00 can you share some code of the catch-all route please? also did you have to override the templates or did you manage to make the default ones work?

I keep getting "login forbidden" in either case, but I might be missing something

tab00 commented 8 years ago

FlowRouter.route('/:id', { action(params, queryParams) { BlazeLayout.render("App_body", { main: "content" }); } }); This route allows a URL like site.com/idchosenbyuser to be handled (like facebook.com/username or soundcloud.com/channelname). But it also means that site.com/somerubbishtext would be handled by the same route (and you'd need to write extra code to handle the case when such an ID doesn't exist). That's why I call it a catch-all route, because it will catch anything that matches site.com/sometext. Whether you need or want such a route depends on your application.

I didn't need to override any default templates. The official Meteor Todos example does some overriding but it's not necessary.