mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6596] - verify ticket on app loading (#9244)
This commit is contained in:
@@ -57,7 +57,12 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|||||||
this.appConfig.onLoad
|
this.appConfig.onLoad
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
if (!this.isOauth() && this.isLoggedIn()) {
|
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');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -70,6 +70,7 @@ describe('AuthenticationService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should emit login event for kerberos', (done) => {
|
it('should emit login event for kerberos', (done) => {
|
||||||
|
spyOn(basicAlfrescoAuthService, 'requireAlfTicket').and.returnValue(Promise.resolve());
|
||||||
const disposableLogin = authService.onLogin.subscribe(() => {
|
const disposableLogin = authService.onLogin.subscribe(() => {
|
||||||
disposableLogin.unsubscribe();
|
disposableLogin.unsubscribe();
|
||||||
done();
|
done();
|
||||||
|
Reference in New Issue
Block a user