auth0-blog / angular2-authentication-sample

This is a sample that shows how to add authentication to an Angular 2 (ng2) app
MIT License
966 stars 334 forks source link

window.jwt_decode is undefined #73

Open georgi-k-small opened 8 years ago

georgi-k-small commented 8 years ago

I am integrating jwt_decode into existing directory but I can't solve this issue. window.jwt_decode is not a function

I also copied the typings/_custom folder as well

snaphuman commented 8 years ago

You can use JwtHelper class to make use of the decodeToken method. See: https://www.npmjs.com/package/angular2-jwt#using-jwthelper-in-components.

In my particular case I decided to provide this class as injectable service that will be available trough all the app.

Greetings!