Fix loop scenario when the login page is not present in silent login (#6512)

* fix loop scenario when the login page is not present in silent login

* fix build

* fix

* remove isECM

* fix unit

* fix
This commit is contained in:
Eugenio Romano
2021-01-11 09:31:11 +00:00
committed by GitHub
parent 62cec5c5b4
commit 8e12e51fb3
7 changed files with 88 additions and 36 deletions

View File

@@ -98,7 +98,6 @@ describe('AuthGuardService ECM', () => {
}));
it('should redirect url if the alfresco js api is NOT logged in and isOAuth with silentLogin', async(() => {
spyOn(router, 'navigateByUrl').and.stub();
spyOn(authService, 'isEcmLoggedIn').and.returnValue(false);
spyOn(authService, 'isOauth').and.returnValue(true);
spyOn(authService, 'isPublicUrl').and.returnValue(false);
@@ -115,8 +114,7 @@ describe('AuthGuardService ECM', () => {
const route: RouterStateSnapshot = <RouterStateSnapshot> {url : 'abc'};
expect(authGuard.canActivate(null, route)).toBeTruthy();
expect(router.navigateByUrl).toHaveBeenCalledTimes(1);
expect(authGuard.canActivate(null, route)).toBeFalsy();
expect(authService.ssoImplicitLogin).toHaveBeenCalledTimes(1);
}));