In my current case I have an Angular application with Azure AD and MSAL v2 implementation. What I want to achieve is when the user is not logged in redirecting them to the custom made Login page with a simple Login (click)="login()" button. I've followed this project to get where I am now but unfortunately after navigating to ' / ' path of localhost:4200 I am getting redirected straight to the Microsoft login page instead of ' /login '. Am I missing something here? Here is my routing module:
const routes: Routes = [
{
path: '',
component: HomeLayoutComponent,
canActivate: [MsalGuard],
children: [
{ path: '', component: WelcomeComponent, pathMatch: 'full'},
{ path: 'map-requests', component: MapRequestsComponent},
{ path: 'map-requests/map-request/details', component: MaprequestDetailComponent }
]
},
{
path: '',
component: LoginLayoutComponent,
children: [
{
path: 'login',
component: LoginComponent
}
]
},
{ path: '**', redirectTo: '' }
];
Found similar question on stack: this