This commit is contained in:
Peter Maquiran
2022-04-07 14:24:07 +01:00
parent 34580da026
commit e8ffcca028
10 changed files with 83 additions and 14 deletions
+10 -5
View File
@@ -6,6 +6,7 @@ import { StorageService } from './storage.service';
import { HttpClient, HttpHeaderResponse } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { Storage } from '@ionic/storage';
import { PermissionService } from './permission.service';
@Injectable({
@@ -29,15 +30,19 @@ export class ChatService {
private authService: AuthService,
private storage: Storage,
private storageService:StorageService,
public p: PermissionService,
)
{
this.loggedUserChat = authService.ValidatedUserChat;
this.headers = new HttpHeaders();
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
this.options = {
headers: this.headers,
};
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
this.options = {
headers: this.headers,
};
}
}