[ACS-6748] BasicAlfrescoAuthService.requireAlfTicket should not be in adf/core (#9393)

This commit is contained in:
dominikiwanekhyland
2024-03-04 10:02:03 +01:00
committed by GitHub
parent 255f472b39
commit 325eef1c32
5 changed files with 158 additions and 10 deletions

View File

@@ -20,7 +20,6 @@ import { Injectable } from '@angular/core';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { StorageService } from '../common/services/storage.service';
import { AuthenticationService, BasicAlfrescoAuthService } from '../auth';
/**
* Create a factory to resolve an api service instance
@@ -38,20 +37,11 @@ export function createAlfrescoApiInstance(angularAlfrescoApiService: AlfrescoApi
export class AlfrescoApiLoaderService {
constructor(private readonly appConfig: AppConfigService,
private readonly apiService: AlfrescoApiService,
private readonly basicAlfrescoAuthService: BasicAlfrescoAuthService,
private readonly authService: AuthenticationService,
private storageService: StorageService) {
}
async init(): Promise<any> {
await this.appConfig.load();
this.authService.onLogin.subscribe(async () => {
if (this.authService.isOauth() && (this.authService.isALLProvider() || this.authService.isECMProvider())) {
await this.basicAlfrescoAuthService.requireAlfTicket();
}
});
return this.initAngularAlfrescoApi();
}