question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No JWT present or has expired after upgrading to Angular4

See original GitHub issue

Hi, I am getting this error after updating from Angular 2 to 4 and I am using the latest angular2-jwt

AuthHttpError {__zone_symbol__error: Error: No JWT present or has expired
    at AuthHttpError.ZoneAwareError (http://localhost:3000/poly……}

I found this issue but even if I comment out the getter function I still get this error.

export function AuthFactory(http: Http, options: RequestOptions) {
    return new AuthHttp(new AuthConfig({
        // tokenName: 'id_token',
        // tokenGetter: (() => localStorage.getItem('id_token')),
        globalHeaders: [{ 'Content-Type': 'application/json' }],
    }), http, options);
};

Any idea why I am getting this error?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
wOOx92commented, May 4, 2017

Thanks! For everyone else getting this error:

angular2-jwt 0.1.28 + Angular 2.x = working angular2-jwt 0.1.28 + Angular 4.x = working angular2-jwt 0.2.0 + Angular 4.x = working angular2-jwt 0.2.1 + Angular 4.x = not working angular2-jwt 0.2.2 + Angular 4.x = not working angular2-jwt 0.2.3 + Angular 4.x = not working

7reactions
dmarques10commented, May 3, 2017

How do you fix this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular2-jwt, getting empty errors in GET/POST responses ...
There is no "No JWT present or has expired" error text, nothing. By the way, standard Http Class is working normally. And so...
Read more >
Auth http: No JWT present or has expired - Auth0 Community
When I'm trying to make an api call I get the response 401 (Unauthorized): No JWT present or has expired. in my app.module.ts,...
Read more >
Check if JWT token is expired using Angular JWT library
Video 40 | Check if JWT token is expired using Angular JWT library ; Playlist: https://www.youtube.com/watch?v=rcq4S... ; Install angular2- jwt : ...
Read more >
Tutorial | Spring Security and Angular
In this tutorial we show some nice features of Spring Security, Spring Boot and Angular working together to provide a pleasant and secure...
Read more >
@auth0/angular-jwt - npm
Those details will vary depending on your setup, but in most cases, you will use a regular HTTP request to authenticate your users...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found