diff --git a/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts b/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts index d514ebf084..65997b890a 100644 --- a/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts +++ b/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts @@ -300,11 +300,11 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { } getBpmUsername(): string { - return this.contentAuth.authentications.basicAuth.username; + return this.processAuth.getUsername(); } getEcmUsername(): string { - return this.processAuth.authentications.basicAuth.username; + return this.contentAuth.getUsername(); } /** diff --git a/lib/core/src/lib/auth/basic-auth/content-auth.ts b/lib/core/src/lib/auth/basic-auth/content-auth.ts index d5edd4bd36..cffcbc5d70 100644 --- a/lib/core/src/lib/auth/basic-auth/content-auth.ts +++ b/lib/core/src/lib/auth/basic-auth/content-auth.ts @@ -79,6 +79,10 @@ export class ContentAuth { this.storageService.setItem('ACS_USERNAME', username); } + getUsername() { + return this.storageService.getItem('ACS_USERNAME'); + } + /** * login Alfresco API * @param username: // Username to login diff --git a/lib/core/src/lib/auth/basic-auth/process-auth.ts b/lib/core/src/lib/auth/basic-auth/process-auth.ts index e27cd2129a..a40a40c2d2 100644 --- a/lib/core/src/lib/auth/basic-auth/process-auth.ts +++ b/lib/core/src/lib/auth/basic-auth/process-auth.ts @@ -64,6 +64,10 @@ export class ProcessAuth { this.storageService.setItem('APS_USERNAME', username); } + getUsername() { + return this.storageService.getItem('APS_USERNAME'); + } + /** * login Activiti API * @param username: // Username to login @@ -166,7 +170,7 @@ export class ProcessAuth { * @param ticket * */ setTicket(ticket: string) { - if(ticket && ticket !=='null') { + if (ticket && ticket !== 'null') { this.authentications.basicAuth.ticket = ticket; this.authentications.basicAuth.password = null; this.config.ticketBpm = ticket; @@ -188,7 +192,7 @@ export class ProcessAuth { * Get the current Ticket * */ getToken(): string { - if(!this.ticket){ + if (!this.ticket) { this.onError.next('error'); return null; }