I'm trying to implement in Angular2, the Auth0 login method from this video. He is also using angular2-jwt
.
I read the documentation, tried to implement it, but i can't get it right.
I tried export class NavbarComponent implements CanActivate
, routerCanActivate(){}
, canActivate(){}
. I'm stuck.
What changes are needed for CanActivate to work in current RC3?
import {CanActivate} from 'angular2/router';
import {tokenNotExpired, JwtHelper} from 'angular2-jwt';
...
@CanActivate (()=>tokenNotExpired())
export class NavbarComponent{
...
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…