i have a question regarding flow router on meteor. in the new project structure for meteor, all files are suggested to be kept in the "imports folder" and be imported to either the server folder or client folder. in the tutorials i have seen that use flow router, there was no imports folder and the routes folder with the js file in it was kept right under the project folder. that raises a few questions for me.
- where does the flow router code run? on the client? on the server? on both?
- if it runs on both, should i leave it outside the imports folder?
- if it runs on both/only on the client, what does that mean security-wise? say i don't want a certain user to be able to access a certain page, so in the flow-router action() i write a code that prevents people from reaching where i don't want them, can't they just change this code on the client and bypass the wall?
- when referring to a user on the flow-router js file, do i use Meteor.userId() or this.userId?.
- i have three functions written inside if(Meteor.isClient) which i copied from a tutorial. the functions are Accounts.onLogin, Accounts.onLogout, FlowRouter.tringgers.enter. can a user hack through them since they are on the client?
thanks in advance!