after login the user is redirected to âdashboard/someidâ
that after clicking a âhref=â/logoutâââ link the user is redirected to â/â
What actually happensâŚ
after login iâm not redirected at all, but i can see âhere1â in console
iâm redirected to â/loginâ and can see "here2 in console
The awkward thing is, when calling FlowRouter.go("/") or FlowRouter.go("/dashboard/"+Session.get(âcurrentâ));via console it works. When selecting the location bar and pressing enter (reload/f5) it also brings me to the desired location.
I am glad someone posted this. For me, this was the most frustrating part of switching to Flow Router. It appears you are using AccountsTemplates to protect routes. In my app I created a global template helper click event that triggers the AccountsTemplates.logout() function. In configuring the useraccounts:flow-routing package, you have to specify what hook to use on logout. Here is what my accounts.js file in my lib directory looks like:
@rogerkirkness this really helped me. I additionally missused Meteor.logout() instead of of the appropriate AccountsTemplate function so the callback wasnât triggered.
-> so the second problem seems to be solvedâŚ
The first one still exists :â( @vegard I never used coffeescript so i donât know if i misunderstand sth there, but in my eyes they simply do a
Accounts.onLogin ->
redirect = Session.get âredirectAfterLoginâ if redirect?
unless redirect is '/login'
FlowRouter.go redirect