In Angular 2 RC1 CanActivate has been depreciated so @CanActivate(() => tokenNotExpired()) no longer works. The angular2-jwt README doesn't reflect this change.
So what do you recommend as the best way to check if user is logged to handle routing?
Thanks
Still looking at the best way to handle this with the new router, so for now samples are using @angular/router-deprecated. One thing you might try is subclassing router-outlet, but I haven't tried this with the new router yet.
I'll update the readme with a note about the deprecated router, thanks :)
The subclass example is also using @angular/router-deprecated so that's probably not the best solution at the moment.
The new router is not really ready to be used. If you were previously using the deprecated router, it is recommended you stay there. If you're developing a new app, you should look at ui-router or ngrx/router
Angular 2 is RC1 and the new router isn't ready?
The core of angular is RC. I personally think they could do a better job setting expectations with the new router by versioning it separately. That however is not a discussion for this issue tracker.
How is Angular2-jwt working with RC3 and the new router3-alpha?
Especially the bootstrap part
I'm looking at that now. I'll should have these examples updated soon.
So Angular published this: https://angular.io/docs/ts/latest/guide/router.html#!#can-activate-guard
Implementing an AuthGuard: http://plnkr.co/edit/?p=preview
Maybe that will help.
I just updated the Auth0 seed projects to RC 3. Check them out to see how to add route protection using canActivate with a custom AuthGuard class.
Most helpful comment
I'm looking at that now. I'll should have these examples updated soon.