-
Notifications
You must be signed in to change notification settings - Fork 92
Angular 8 + @auth0/angular-jwt #138
Comments
Hi @Inexad , ng-chat does use the HttpClientModule as part of its imports. It's mainly used to handle file uploads. Do you have the setting to enable file uploads on? In terms of headers or possible interference I can't think of anything that could be causing such behavior. Have a look at this file as this is where ng-chat uses a Perhaps it could be related to your adapter implementation? |
Hi @rpaschoal, The ng-chat code i use is the example i found here: The wierd thing is that if i remove all code related to the example and only import the module (No adapters, no components eg) i get the same behaviour. I will try to reproduce this in a clean angular project. Regards. |
Hi again, I could reproduce the problem and it appears to be because of lazy-loading. Everything works as normal when not including "ngchatmodule" in the lazy loaded module. After loading it into lazy-loaded module the bearer token for some reason gets removed from authentication header. When importing chat-component and ngchatmodule directly into app.module it works. But not into lazy loaded module. Is there any way to get this working with Lazy Loaded modules? I've tried to upload the files to a StackBlitz (not sure why its not working): https://stackblitz.com/edit/angular-vmj9zf Regards. |
@Inexad this seems related: angular/angular#20575 Some interesting read on this on another lib: dimpu/ngx-md#159 and here a PR to address the issue on the same lib dimpu/ngx-md#169 Long story short this seems to be by design on Angular and I am not too sure if we should remove the On your application is it a blocker to have the ng-chat module loaded up with the main application module? |
@rpaschoal I think removing the HttpClientModule would not be a good idea. If i understand this correct, the Angular handling these issues with the "forRoot()" and "forChild()" methods? Is it possible to implement forRoot() in ngchat? Sadly it is a problem. The application is quite big and i'm trying to keep the different bundles down by lazy loading. |
I see @Inexad , would you be keen on creating a fork of ng-chat and giving |
Sorry for late reply @rpaschoal . Yes, that is maybe something i can do. I will have a look at it when i got some time over. |
Stuck with the same issue. Waiting for the patch. |
I'm running short on time these days but will be looking closely if @Inexad gets to push a fixing patch for it via a pull request. |
Hello, I am having an issue using ng-chat in angular 8 based application . Any help would be appreciated. Thanks in advance |
With the package now running on Angular 9, could any of you confirm this is still an issue? @Inexad @rejahrehim |
we are facing the same issue. the ngchatModule resets the interceptor configuration. we will appreciate if you could remove the HttpClientModule from the imports of the library and let the developers add it to there modules. |
All my http bearer tokens (JWT) get removed after including: NgChatModule in my app.module.ts.
I'm using package @auth0/angular-jwt for handling my bearer tokens. It uses a http interceptor and add the token to http header. For some reason this bearer is lost if i import NgChatModule. If i remove NgChatModule it works as intended.
Is NgChatModule interfering with some http interception ?
The text was updated successfully, but these errors were encountered: