Configuration with factory doesn't work
See original GitHub issueHi there, i’m using “@auth0/angular-jwt”: “^4.0.0”,. I followed documentation: https://github.com/auth0/angular2-jwt#configuration-for-ionic-2
But factory doesn’t work. Doesn’t work with ionic storage neither localstorage.
export function jwtOptionsFactory(storage: Storage) {
return {
tokenGetter: () => {
// return storage.get('access_token');
return localStorage.getItem('access_token');
}
}
}
...
JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [Storage]
}
}),
Without factory, it works fine:
export function tokenGetter() {
return localStorage.getItem('access_token');
}
...
JwtModule.forRoot({
config: {
tokenGetter: tokenGetter,
whitelistedDomains: endpoint.jwtWhitelist
}
}),
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Reset your Android device to factory settings - Google Support
Open your phone's Settings app. Tap Accounts. If you don't have the option to tap "Accounts," get help from your device manufacturer. You'll...
Read more >Solved: Reset to factory default doesn't work on 1142 AP
We want to reset to factory defaults because we want to delete the configuration and force the AP to get a new config...
Read more >Unable to factory default my srx240 firewall | SRX
Hi guys, need help on this as i was unable to reset my firewall to factory default either from reset button or command...
Read more >Where to store "factory defaults" configuration settings, so they ...
We need to store the factory defaults in a file that is included in the executable, or distributed with it. We can write...
Read more >How To Factory Reset Any Windows 10 Computer - YouTube
If they don't work, comment with your exact model and we can help find the correct F Key. Q: What if the factory...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The documentation has been updated to be clearer about configuring the options with a
jwtOptionsFactory
.Thank you very much @Sambego , you saved my life!!!