Should not redirect if is SilentLogin on (#5216)

* fix redirect

* fix lint

* remove false behaviour alrady tested in the new unit test

* Update auth-guard-base.ts
This commit is contained in:
Eugenio Romano
2019-11-06 13:56:01 +02:00
committed by Denys Vuika
parent 3c1097fb84
commit 5578b7b851
4 changed files with 27 additions and 38 deletions

View File

@@ -92,17 +92,6 @@ describe('AuthGuardService BPM', () => {
expect(router.navigateByUrl).toHaveBeenCalled();
}));
it('should redirect url if the alfresco js api is NOT logged in and isOAuthWithSilentLogin', async(() => {
spyOn(router, 'navigateByUrl').and.stub();
spyOn(authService, 'isBpmLoggedIn').and.returnValue(false);
spyOn(authService, 'isOauth').and.returnValue(true);
appConfigService.config.oauth2.silentLogin = true;
const route: RouterStateSnapshot = <RouterStateSnapshot> {url : 'some-url'};
expect(authGuard.canActivate(null, route)).toBeFalsy();
expect(router.navigateByUrl).toHaveBeenCalled();
}));
it('should redirect url if NOT logged in and isOAuth but no silentLogin configured', async(() => {
spyOn(router, 'navigateByUrl').and.stub();
spyOn(authService, 'isBpmLoggedIn').and.returnValue(false);