Comments (12)
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.
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.
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.
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.
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.
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.
This lib is actually for Angular 1. You're looking for http://github.com/auth0/angular2-jwt
from angular-jwt.
thanks alot.
from angular-jwt.
Is it in the master? should I update?
from angular-jwt.
Oho - I just saw the chenkie comment, I think he is right, SO I am closing this issue.
Thanks chenkie.
from angular-jwt.
you are using angular2-jwt. change it to @auth0/angular-jwt.
from angular-jwt.
@hesampour thanks bro it worked after moving to @auth0/angular-jwt v2
from angular-jwt.
Related Issues (20)
- Minification problems HOT 2
- urlBase64Decode issue HOT 3
- Restangular not setting the token on requests HOT 1
- --prod build. Function expressions are not supported in decorators in 'ɵ0' HOT 2
- SSR is failing window doesn't exist HOT 2
- How the Payload will get converted in the JWT Token ? HOT 1
- Breaking changes in latest patch release 0.1.10 HOT 1
- Can't run test suite
- Don't reference actual window HOT 1
- Interceptor can choke on undefined response HOT 5
- Can't inject anything to jwtOptionsProvider tokenGetter config HOT 2
- Routes without jwt authentication are still loading HOT 1
- async TokenGetter doesn't work HOT 1
- Help needed to implement the basic functions HOT 1
- ERROR Error: Uncaught (in promise): TypeError: this.tokenGetter is not a function HOT 2
- Error: Could not get token from tokenGetter function HOT 1
- Bower failed with error: The process 'C:\npm\prefix\bower.cmd' failed with exit code 1
- Create Ivy distribution HOT 1
- Support Ivy distribution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-jwt.