mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
connect to socket server
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user