fix rocket chat session

This commit is contained in:
Peter Maquiran
2022-01-29 20:34:36 +01:00
parent b06e155d20
commit eb504f5342
3 changed files with 19 additions and 18 deletions
+15 -11
View File
@@ -13,7 +13,7 @@ import { Observable, Subject } from "rxjs/Rx";
providedIn: 'root'
})
export class ChatService {
headers: HttpHeaders;
_headers: HttpHeaders;
options:any;
options1:any;
X_User_Id:any;
@@ -31,19 +31,23 @@ export class ChatService {
private storage: Storage,
private storageService:StorageService,
)
{
this.setHeader()
window['setChatHeader'] = this.setHeader
{}
get headers() {
this.loggedUserChat = this.authService.ValidatedUserChat;
this._headers = new HttpHeaders();
this._headers = this._headers.set('X-User-Id', this.loggedUserChat['data'].userId);
this._headers = this._headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
this.options = {
headers: this._headers,
};
return this._headers
}
setHeader = () => {
this.loggedUserChat = this.authService.ValidatedUserChat;
this.headers = new HttpHeaders();
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
this.options = {
headers: this.headers,
};
}
getDocumentDetails(url:string){