Comments (4)
Whoa okay! I'm really sorry for this pointless post.
Indeed, I did not add "withInterceptorsFromDi()". The concept of standalone components is still vague for me, you would say..
Would it be relevant to add something in the documentation for the standalone configuration? Something like this:
In main.ts file
import {JwtModule} from "@auth0/angular-jwt";
import {provideHttpClient, withInterceptorsFromDi} from "@angular/common/http";
// ...
export function tokenGetter() {
return localStorage.getItem("access_token");
}
bootstrapApplication(AppComponent, {
providers: [
// ...
importProvidersFrom(
// ...
JwtModule.forRoot({
config: {
tokenGetter: tokenGetter,
allowedDomains: ["example.com"],
disallowedRoutes: ["http://example.com/examplebadroute/"],
},
}),
),
provideHttpClient(
withInterceptorsFromDi()
),
],
});
from angular2-jwt.
Thanks for reaching out, did you verify the exact same configuration works without using standalone?
Also, be sure to call withInterceptorsFromDi
, on provideHttpClient
to ensure Angular uses the class based interceptors.
from angular2-jwt.
Even though this is something you will need to do for any library that does not provide standalone ways to register its artifacts, I guess we could add something, or even provide the artifacts so that it would just work like you'd expect (like we did here auth0/auth0-angular#445), happy to review a PR that does either of that.
from angular2-jwt.
Closing for now, happy to review a PR if anyone would want.
from angular2-jwt.
Related Issues (20)
- tokenGetter using async documentation not complete
- Error: The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more. HOT 1
- Angular 12 support HttpInterceptor Context HOT 4
- Angular 13 support HOT 28
- upstream dependency conflict while installing angular2-jwt package using angular-cli HOT 1
- ``
- v5.1.0 broke azure devops publishing HOT 5
- Please respect semver HOT 3
- tokenGetter does not support Promise HOT 2
- Getting an issue of no exported member from angular core HOT 1
- Encourage the library authors to publish an Ivy distribution HOT 2
- Release v5.1.1 decodeToken<T = any>(token?: string): T | Promise<T> HOT 4
- 'ɵɵngDeclareFactory' (imported as 'i0') was not found in '@angular/core' HOT 2
- Authorization header stops going through after the browser sits idle for a while. HOT 7
- JwtInterceptor not work HOT 2
- Angular 16 support HOT 1
- Package not working with es2022 HOT 4
- Angular JWT 5.0.2 not compiling with Angular 13.3.6 HOT 1
- App no longer working after installing auth0 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 angular2-jwt.