I've got a simple guard on my admin area
{
path: 'admin',
canLoad: [AuthGuard, AccountGuard],
loadChildren: () =>
import('./features/admin/admin.module').then((m) => m.AdminModule),
data: { preload: false }
},
It works nice the first time I do login but if I do logout and than login again it doesn't work so I ended up with
{
path: 'admin',
canLoad: [AuthGuard, AccountGuard],
canActivate: [AuthGuard, AccountGuard],
loadChildren: () =>
import('./features/admin/admin.module').then((m) => m.AdminModule),
data: { preload: false }
},
I'm wondering is there a better way?