pass actual redirect when no state (#3285)

This commit is contained in:
Cilibiu Bogdan
2018-05-09 09:59:03 +03:00
committed by Denys Vuika
parent 4fbacf4860
commit f63614e964
6 changed files with 63 additions and 0 deletions

View File

@@ -63,6 +63,11 @@ export class AuthGuard implements CanActivate, CanActivateChild {
private getNavigationCommands(redirectUrl: string): any[] {
const urlTree: UrlTree = this.router.parseUrl(redirectUrl);
const urlSegmentGroup: UrlSegmentGroup = urlTree.root.children[PRIMARY_OUTLET];
if (!urlSegmentGroup) {
return [redirectUrl];
}
const urlSegments: UrlSegment[] = urlSegmentGroup.segments;
return urlSegments.reduce(function(acc, item) {