mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
solved unauthorized rockect chat url
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user