fix rocket chat session

This commit is contained in:
Peter Maquiran
2022-01-29 20:16:39 +01:00
parent 34208d8040
commit acacb58d0d
4 changed files with 31 additions and 7 deletions
+6 -3
View File
@@ -11,6 +11,7 @@ import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service';
import { CookieService } from 'ngx-cookie-service';
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { ChatService } from './chat.service';
@Injectable({
providedIn: 'root'
})
@@ -31,7 +32,8 @@ export class AuthService {
public alertController: AlertController,
private aesencrypt: AESEncrypt,
private cookieService: CookieService,
private WsChatService: WsChatService) {
private WsChatService: WsChatService,
private ChatService: ChatService) {
this.headers = new HttpHeaders();
@@ -116,8 +118,9 @@ export class AuthService {
if(responseChat) {
setTimeout(()=>{
console.log('login', SessionStore.user.RochetChatUser, SessionStore.user.Password)
this.WsChatService.connect();
this.WsChatService.login().then((message) => {
@@ -133,8 +136,8 @@ export class AuthService {
this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat);
this.ChatService.setHeader()
return true;
}