beforeModel not called in route

I’m currently investigating a strange problem that was reported for my library Ember.SimpleAuth (see issue here: https://github.com/simplabs/ember-simple-auth/issues/74).

There’s also a JSBin: http://emberjs.jsbin.com/UpUcIHoh/8/edit

Steps to reproduce the problem are:

  • login with any username/password
  • go to “reports”
  • log out

now what should happen is:

session is destroyed (that’s in the Ember.SimpleAuth.ApplicationRouteMixin mixin) and the app transitions to ‘index’ which transitions to ‘reports’ where beforeModel should transition to ‘login’ as the session is no longer authenticated (that’s in the Ember.SimpleAuth.AuthenticatedRouteMixin mixin).

What actually happens is that ReportsRoute#beforeModel is not called in the last step and the app successfully enters the report route again. Is that because it recognizes it already is at that route?

Would really appreciate help, can’t find out what the problem is here.

Update

By setting

LOG_TRANSITIONS_INTERNAL: true

I can verify that beforeModel is not called on the reports route (logger says “Transition #6: reports: using context from already-active handler”). Is there a way to force reevaluation of beforeModel?