mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
changes on Rocket Chat authentication
This commit is contained in:
@@ -22,7 +22,7 @@ export class ChatService {
|
||||
|
||||
SERVER_URL = 'wss://www.tabularium.pt/websocket';
|
||||
public messages: Subject<any>;
|
||||
|
||||
loggedUserChat:any;
|
||||
|
||||
constructor(
|
||||
private http:HttpClient,
|
||||
@@ -33,11 +33,10 @@ export class ChatService {
|
||||
private wsService: WebsocketService,
|
||||
)
|
||||
{
|
||||
this.loggedUserChat = authService.ValidatedUserChat;
|
||||
this.headers = new HttpHeaders();
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.headers = this.headers.set('X-User-Id', res.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', res.authToken);
|
||||
});
|
||||
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,
|
||||
};
|
||||
@@ -48,25 +47,6 @@ export class ChatService {
|
||||
return (JSON.stringify(data));
|
||||
});
|
||||
}
|
||||
|
||||
/* getUser(){
|
||||
this.storage.get('user').then((val) => {
|
||||
let user = JSON.parse(unescape(atob(val))).data;
|
||||
|
||||
this.headers = this.headers.set('X-User-Id', user.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', user.authToken);
|
||||
|
||||
this.options1 = {
|
||||
headers: this.headers,
|
||||
};
|
||||
console.log(this.options1);
|
||||
|
||||
this.http.get(environment.apiChatUrl+'users.presence', this.options1).subscribe(res => {
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
});
|
||||
} */
|
||||
|
||||
getAllChannels(){
|
||||
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
|
||||
@@ -108,7 +88,6 @@ export class ChatService {
|
||||
|
||||
//Load messages from roomId
|
||||
getAllDirectMessages(){
|
||||
console.log(this.options);
|
||||
return this.http.get(environment.apiChatUrl+'im.list', this.options);
|
||||
}
|
||||
//Load messages from roomId
|
||||
|
||||
Reference in New Issue
Block a user