connect to socket server

This commit is contained in:
Peter Maquiran
2022-01-07 09:03:15 +01:00
parent 73354e00af
commit 6e0b54c0cf
6 changed files with 185 additions and 3 deletions
+5 -1
View File
@@ -10,6 +10,7 @@ import { AlertController } from '@ionic/angular';
import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service';
import { CookieService } from 'ngx-cookie-service';
import { RocketChatClientService } from '../services/socket/rocket-chat-client.service';
@Injectable({
providedIn: 'root'
@@ -29,6 +30,7 @@ export class AuthService {
public alertController: AlertController,
private aesencrypt: AESEncrypt,
private cookieService: CookieService,
private RocketChatClientService: RocketChatClientService
) {
this.headers = new HttpHeaders();
@@ -99,8 +101,10 @@ export class AuthService {
console.log(postData);
this.RocketChatClientService.login(postData)
let responseChat = await this.httpService.post('login', postData).toPromise();
if(responseChat){
if(responseChat) {
console.log('Login to Rocket chat OK');
this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat));