This commit is contained in:
Peter Maquiran
2023-01-18 11:59:53 +01:00
parent 46296813b8
commit b890b58a86
8 changed files with 67 additions and 29 deletions
+6 -12
View File
@@ -24,22 +24,16 @@ export class AttachmentsService {
private changeProfileService: ChangeProfileService) {
this.changeProfileService.registerCallback(() => {
this.loggeduser = SessionStore.user
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
})
this.changeProfileService.registerLoginCallback(() => {
this.loggeduser = SessionStore.user
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
})
this.setHeader()
});
this.setHeader()
}
setHeader() {
this.loggeduser = SessionStore.user
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
}
uploadFile(formData:any) {
+2 -4
View File
@@ -25,7 +25,7 @@ import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
export class AuthService {
userData$ = new BehaviorSubject<any>('');
userId$ = new BehaviorSubject<any>('');
headers: HttpHeaders;
headers: HttpHeaders = new HttpHeaders();
public wsValidatedUserChat:any;
public isWsAuthenticated: boolean = false;
opts:any;
@@ -43,9 +43,7 @@ export class AuthService {
private storage: Storage,
private initialsService: InitialsService,
public p: PermissionService,
public ChatSystemService: ChatSystemService, ) {
this.headers = new HttpHeaders();
public ChatSystemService: ChatSystemService) {
if (SessionStore.exist) {
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
+13 -1
View File
@@ -6,6 +6,7 @@ import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model';
import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -16,7 +17,18 @@ export class ContactsService {
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
-2
View File
@@ -583,8 +583,6 @@ export class EventsService {
});
}
getAllSharedOficialEvents(startdate: string, enddate: string): Observable<Event[]> {
let geturl = environment.apiURL + 'calendar/pr';
geturl = geturl.replace('/V4/', '/V5/')
+13 -1
View File
@@ -7,6 +7,7 @@ import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model';
import { OrganicEntity } from 'src/app/models/organic-entity.model';
import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -17,7 +18,18 @@ export class OrganicEntityService {
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
+12 -2
View File
@@ -9,6 +9,7 @@ import { Publication } from '../models/publication';
import { getUrl } from 'ionicons/dist/types/components/icon/utils';
import { ActivatedRoute, Router } from '@angular/router';
import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -23,11 +24,20 @@ export class PublicationsService {
constructor(private http: HttpClient, user: AuthService,
private activatedRoute: ActivatedRoute,
private router: Router) {
private router: Router,
private changeProfileService: ChangeProfileService,) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader () {
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
GetPublicationFolderList(){
+15 -1
View File
@@ -8,6 +8,7 @@ import { LoginUserRespose } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search';
import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -21,7 +22,20 @@ export class SearchService {
categories= Array;
// setup
constructor(private http: HttpClient, user: AuthService) {
constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader();
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);