I've got these routes:
{
path: 'admin',
canLoad: [AuthGuard, AccountGuard],
loadChildren: () =>
import('./features/admin/admin.module').then(m => m.AdminModule),
data: { preload: false }
},
{
path: 'auth',
loadChildren: () =>
import('./features/auth/auth.module').then(m => m.AuthModule),
data: { preload: false }
}
At login, both are triggered but when in the admin area I do logout deleting both auth and account states, redirecting to the auth route if I do login again without refresh only the first is triggered. I've tried using
onSameUrlNavigation: 'reload'
runGuardsAndResolvers: 'always'
but I still have the same behavior.
Any ideas?
NB I've also tried putting a simple console.log in the AccountGuard like
canLoad(): Observable<boolean> {console.log('Account)}
but in the second login I don't see any message in the dev tools