I want to have multiple components associated to the root path in order to display one landing page view for anonymous users and an inbox for the authenticated users, without having to use manual navigation and path changes crutches.
I've tried to enable my scenario with a routing block like this:
{ path: '', component: LandingComponent, canActivate: [ ForbidAuthGuard ] },
{ path: '', component: LocationsComponent, canActivate: [ RequireAuthGuard ] }
Angular is indeed calling ForbidAuthGuard, which is failing on an authenticated user and therefore cancelling the navigation event altogether, ignoring the RequireAuthGuard route.
As implied by their conflicting names both guards are exclusive to each other so only one of the routes will ever be active, yet Angular seems to be ignoring the second route.
Is this mechanic viable at all? or Is there any other technique to achieve the end goal of the first paragraph?.
For completeness' sake I am using @angular/router and @angular/core with version 5.2.8.