[ACS-6596] - verify ticket on app loading (#9244)

This commit is contained in:
DominikIwanek
2024-01-18 14:21:54 +01:00
committed by GitHub
parent d95e46e485
commit 7a40a614a4
2 changed files with 7 additions and 1 deletions

View File

@@ -57,7 +57,12 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
this.appConfig.onLoad
.subscribe(() => {
if (!this.isOauth() && this.isLoggedIn()) {
this.requireAlfTicket().then(() => {
this.onLogin.next('logged-in');
}).catch(() => {
this.contentAuth.invalidateSession();
this.onLogout.next('logout');
});
}
});

View File

@@ -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();