mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Do redirect before implicit button (#6574)
* Do redirect before implicit * Add unit to implicit and silent * Keep the value as it was before
This commit is contained in:
@@ -609,14 +609,13 @@ describe('LoginComponent', () => {
|
||||
describe('implicitFlow ', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
appConfigService.config.oauth2 = <OauthConfigModel> { implicitFlow: true };
|
||||
appConfigService.config.oauth2 = <OauthConfigModel> { implicitFlow: true, silentLogin: false };
|
||||
appConfigService.load();
|
||||
alfrescoApiService.reset();
|
||||
});
|
||||
|
||||
it('should not show login username and password if SSO implicit flow is active', async(() => {
|
||||
spyOn(authService, 'isOauth').and.returnValue(true);
|
||||
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -628,6 +627,34 @@ describe('LoginComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should not render the implicitFlow button in case silentLogin is enabled', async(() => {
|
||||
spyOn(authService, 'isOauth').and.returnValue(true);
|
||||
appConfigService.config.oauth2 = <OauthConfigModel> { implicitFlow: true, silentLogin: true };
|
||||
|
||||
spyOn(component, 'redirectToImplicitLogin').and.returnValue(Promise.resolve({}));
|
||||
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.implicitFlow).toBe(false);
|
||||
expect(component.redirectToImplicitLogin).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
}));
|
||||
|
||||
it('should render the implicitFlow button in case silentLogin is disabled', async(() => {
|
||||
spyOn(authService, 'isOauth').and.returnValue(true);
|
||||
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.implicitFlow).toBe(true);
|
||||
});
|
||||
|
||||
}));
|
||||
|
||||
it('should not show the login base auth button', async(() => {
|
||||
spyOn(authService, 'isOauth').and.returnValue(true);
|
||||
|
||||
|
Reference in New Issue
Block a user