Giter Club home page Giter Club logo

Comments (12)

ShayMe21 avatar ShayMe21 commented on July 3, 2024 8

The naming of the packages can make you confused actually.

According to here (https://www.npmjs.com/package/@auth0/angular-jwt), you should be using @auth0/angular-jwt that supports Angular6+.

Please try with npm install @auth0/angular-jwt instead. I tested this earlier following the upgrade plan here (https://update.angular.io/) with the Angular2+ QuickStart SDK on Auth0 worked just fine.

from angular-jwt.

timfogarty-row8 avatar timfogarty-row8 commented on July 3, 2024 4

the issue is rxjs 6.0. It looks like only three changes need to be made:

In jwt.interceptor.d.ts, and in jtw.interceptor.js, change

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/operator/mergeMap';

to

import { Observable, pipe } from 'rxjs';
import { fromPromise, mergeMap } from 'rxjs/operators';

then in the js file, change

return Observable.fromPromise(token).mergeMap(function (asyncToken) {
      return _this.handleInterception(asyncToken, request, next);
  });

to

return Observable.pipe(fromPromise(token),mergeMap(function (asyncToken) {
      return _this.handleInterception(asyncToken, request, next);
}));

Note that gets it to compile, but I've done no testing on it.

from angular-jwt.

nhrrsn avatar nhrrsn commented on July 3, 2024 4

It works but the package rxjs-compat is still required for backwards compatibility. Any idea when rxjs-compat can be removed?

ERROR in node_modules/@auth0/angular-jwt/src/jwt.interceptor.d.ts(3,10): error TS2305: Module '"/home/user/project/node_modules/rxjs/Observable"' has no exported member 'Observable'. node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.

from angular-jwt.

krushnachandra avatar krushnachandra commented on July 3, 2024 1

ERROR TypeError: Observable_1.Observable.defer is not a function
at AuthHttp.push../node_modules/angular2-jwt/angular2-jwt.js.AuthHttp.request (angular2-jwt.js:140)
at AuthHttp.push../node_modules/angular2-jwt/angular2-jwt.js.AuthHttp.requestHelper (angular2-jwt.js:104)
at AuthHttp.push../node_modules/angular2-jwt/angular2-jwt.js.AuthHttp.get (angular2-jwt.js:151)

getting this error after updating to angular 6

from angular-jwt.

hesampour avatar hesampour commented on July 3, 2024

I get the following error:
Package "@auth0/angular-jwt" has an incompatible peer dependency to "@angular/common" (requires "^4.4.6||^5.0.0", would install "6.0.0")

from angular-jwt.

hesampour avatar hesampour commented on July 3, 2024

after adding everything and trying alot get the followng error in browser console
ReferenceError: angular is not defined
at angular-jwt.js:9
at Object../node_modules/angular-

would you please fix the issue for angular 6

from angular-jwt.

chenkie avatar chenkie commented on July 3, 2024

This lib is actually for Angular 1. You're looking for http://github.com/auth0/angular2-jwt

from angular-jwt.

hesampour avatar hesampour commented on July 3, 2024

thanks alot.

from angular-jwt.

josuevalrob avatar josuevalrob commented on July 3, 2024

Is it in the master? should I update?

from angular-jwt.

 avatar commented on July 3, 2024

Oho - I just saw the chenkie comment, I think he is right, SO I am closing this issue.
Thanks chenkie.

from angular-jwt.

hesampour avatar hesampour commented on July 3, 2024

you are using angular2-jwt. change it to @auth0/angular-jwt.

from angular-jwt.

krushnachandra avatar krushnachandra commented on July 3, 2024

@hesampour thanks bro it worked after moving to @auth0/angular-jwt v2

from angular-jwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.