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 0808fa31e0..74761ee40d 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 @@ -57,7 +57,12 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { this.appConfig.onLoad .subscribe(() => { if (!this.isOauth() && this.isLoggedIn()) { - this.onLogin.next('logged-in'); + this.requireAlfTicket().then(() => { + this.onLogin.next('logged-in'); + }).catch(() => { + this.contentAuth.invalidateSession(); + this.onLogout.next('logout'); + }); } }); diff --git a/lib/core/src/lib/auth/services/authentication.service.spec.ts b/lib/core/src/lib/auth/services/authentication.service.spec.ts index 16f35e5191..23747588a3 100644 --- a/lib/core/src/lib/auth/services/authentication.service.spec.ts +++ b/lib/core/src/lib/auth/services/authentication.service.spec.ts @@ -70,6 +70,7 @@ describe('AuthenticationService', () => { }); it('should emit login event for kerberos', (done) => { + spyOn(basicAlfrescoAuthService, 'requireAlfTicket').and.returnValue(Promise.resolve()); const disposableLogin = authService.onLogin.subscribe(() => { disposableLogin.unsubscribe(); done();