mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3162] Setting component - Should be able to render the providers passed as input (#3464)
* Be able to change the available providers values * Add deprecated tag * add default providers * Fix empty OAuth and selected providers Improve the documentation * Fix BPM guard to check SSO condition * Add the oauthConfig again * SSO or Basic otpion auth setting change * fix host settings sso/basic add login documentation * remove test string * fix auth guard test * dispose upload emitter test events * remove space * exclude failing test
This commit is contained in:
committed by
Eugenio Romano
parent
9221d1d0d0
commit
476b5864bf
@@ -22,11 +22,13 @@ import {
|
||||
} from '@angular/router';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
@Injectable()
|
||||
export class AuthGuardBpm implements CanActivate, CanActivateChild {
|
||||
constructor(private authService: AuthenticationService,
|
||||
private router: Router,
|
||||
private userPreference: UserPreferencesService,
|
||||
private appConfig: AppConfigService) {}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
||||
@@ -42,15 +44,21 @@ export class AuthGuardBpm implements CanActivate, CanActivateChild {
|
||||
return true;
|
||||
}
|
||||
|
||||
const navigation = this.getNavigationCommands(redirectUrl);
|
||||
if (!this.authService.isOauth() || this.isOAuthWithoutSilentLogin() ) {
|
||||
const navigation = this.getNavigationCommands(redirectUrl);
|
||||
|
||||
this.authService.setRedirect({ provider: 'BPM', navigation });
|
||||
const pathToLogin = this.getRouteDestinationForLogin();
|
||||
this.router.navigate(['/' + pathToLogin]);
|
||||
this.authService.setRedirect({ provider: 'BPM', navigation });
|
||||
const pathToLogin = this.getRouteDestinationForLogin();
|
||||
this.router.navigate(['/' + pathToLogin]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
isOAuthWithoutSilentLogin() {
|
||||
return this.authService.isOauth() && this.userPreference.oauthConfig.silentLogin === false;
|
||||
}
|
||||
|
||||
private getRouteDestinationForLogin(): string {
|
||||
return this.appConfig &&
|
||||
this.appConfig.get<string>('loginRoute') ?
|
||||
|
Reference in New Issue
Block a user