I try to redirect the user to another page on login. But when I call Router.go in my sumbit hook, Router is undefined. I tried to change the loading order by changing the filename of my accountConfig but it didnot work.
AccountsTemplates.configure(
onSubmitHook:
Router.go(’/map’) # HERE ROUTER IS STILL UNDEFIED
)
You can use Router.onBeforeAction. However in this case I have only a single page where the user can log in, as it’s essentially a single page app with a logged out page and a couple logged in pages you can’t visit while anonymous.