mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2904] Search - redirect breaks application (#3268)
* set navigation commands over plain string * fix test * lint
This commit is contained in:
committed by
Eugenio Romano
parent
c90ad3f875
commit
d456b3cba1
@@ -33,7 +33,7 @@ const REMEMBER_ME_UNTIL = 1000 * 60 * 60 * 24 * 30 ;
|
||||
|
||||
@Injectable()
|
||||
export class AuthenticationService {
|
||||
private redirectUrl: RedirectionModel = null;
|
||||
private redirect: RedirectionModel = null;
|
||||
|
||||
onLogin: Subject<any> = new Subject<any>();
|
||||
onLogout: Subject<any> = new Subject<any>();
|
||||
@@ -246,24 +246,24 @@ export class AuthenticationService {
|
||||
/** Sets the URL to redirect to after login.
|
||||
* @param url URL to redirect to
|
||||
*/
|
||||
setRedirectUrl(url: RedirectionModel) {
|
||||
this.redirectUrl = url;
|
||||
setRedirect(url: RedirectionModel) {
|
||||
this.redirect = url;
|
||||
}
|
||||
|
||||
/** Gets the URL to redirect to after login.
|
||||
* @param provider Service provider. Can be "ECM", "BPM" or "ALL".
|
||||
* @returns The redirect URL
|
||||
*/
|
||||
getRedirectUrl(provider: string): string {
|
||||
return this.hasValidRedirection(provider) ? this.redirectUrl.url : null;
|
||||
getRedirect(provider: string): any[] {
|
||||
return this.hasValidRedirection(provider) ? this.redirect.navigation : null;
|
||||
}
|
||||
|
||||
private hasValidRedirection(provider: string): boolean {
|
||||
return this.redirectUrl && (this.redirectUrl.provider === provider || this.hasSelectedProviderAll(provider));
|
||||
return this.redirect && (this.redirect.provider === provider || this.hasSelectedProviderAll(provider));
|
||||
}
|
||||
|
||||
private hasSelectedProviderAll(provider: string): boolean {
|
||||
return this.redirectUrl && (this.redirectUrl.provider === 'ALL' || provider === 'ALL');
|
||||
return this.redirect && (this.redirect.provider === 'ALL' || provider === 'ALL');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user