JWT Interceptor does not attach header to the request (prod)
See original GitHub issueHi,
I use the version 2.0.0 with angular 6, but the JWT Interceptor does not attach header to the request, but this only occurs by executing the ng serve --prod or ng build --prod, generated in development mode it works without problems.
My configuration is as follows:
`export function tokenGetter () { return localStorage.getItem (‘token’); }
const jwtConf: JwtModule = { config: { tokenGetter: tokenGetter, whitelistedDomains: environment.tokenWhitelistedDomains, blacklistedRoutes: environment.tokenBlacklistedRoutes } }
@NgModule ({ imports: FormsModule, CommonModule, JwtModule.forRoot (jwtConf), SecurityRoutingModule ]`
And the enviroments:
`export const environment = { production: true, origin: ‘http://localhost:8080/api/’,
tokenWhitelistedDomains: [‘localhost: 8080’], tokenBlacklistedRoutes: [new RegExp (‘\ /oauth/token’)] };`
I have tried in many ways, but without success.
Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
I had the same problem fixed it by changing the environments
Thanks @willianfalbo, we will be adding this to the documentation so that people don’t hit this problem in the future, as per #593