solved unauthorized rockect chat url

This commit is contained in:
tiago.kayaya
2021-10-05 10:18:38 +01:00
parent 3f99ea222c
commit 5d4490e287
8 changed files with 34 additions and 30 deletions
+3 -1
View File
@@ -65,7 +65,7 @@ export class AuthService {
}
SetSession(response: LoginUserRespose, user:UserForm) {
const session: UserSession = Object.assign(SessionStore.user, response)
const session: UserSession = Object.assign(SessionStore.user, response)
if (response) {
if( session.RoleID == 100000014) {
@@ -102,6 +102,8 @@ export class AuthService {
console.log('Login to Rocket chat OK');
this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat));
localStorage.setItem('Meteor.loginToken', JSON.stringify(responseChat['data'].userId));
localStorage.setItem('Meteor.userId', JSON.stringify(responseChat['data'].authToken));
this.storageService.store(AuthConnstants.AUTH, responseChat);
return true;
}
+1 -3
View File
@@ -9,7 +9,6 @@ import { Storage } from '@ionic/storage';
import { Message } from 'src/app/models/message.model';
import { Observable, Subject } from "rxjs/Rx";
import { WebsocketService } from './websocket.service';
import { FileService } from './functions/file.service';
@Injectable({
providedIn: 'root'
@@ -32,7 +31,6 @@ export class ChatService {
private authService: AuthService,
private storage: Storage,
private storageService:StorageService,
private fileService: FileService,
//private wsService: WebsocketService,
)
{
@@ -63,7 +61,7 @@ export class ChatService {
};
let fullUrl = "https://www.tabularium.pt/" + url;
return this.http.get(fullUrl, optionsc).subscribe(()=>{
this.fileService.viewDocumentByUrl(url)
//this.fileService.viewDocumentByUrl(url)
});
}
+1 -1
View File
@@ -252,7 +252,7 @@ export class FileService {
}
viewDocumentByUrl(url) {
const browser = this.iab.create(url,"_blank");
const browser = this.iab.create(url,"_parent");
browser.show();
}
}