-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support canActivate Guards on routes #25
Comments
Hi @xmlking , it seems a good idea, but is there any API Propasol so we can have a clear idea ? |
Thinking something like this. const routes: Routes = [
{
path: '/api',
canActivate: [AuthGuard] ,
children: [
{
path: '/cats',
module: CatsModule,
canActivate: [CatGuard]
},
{
path: '/dogs',
module: DogsModule,
canActivate: [DogGuard]
},
],
},
]; The question for discussion: |
Hmm, i'm thinking since In my opinion it just a helper or a method sugar for applying guards to modules. |
Agree, most of us adding guards via APP_GUARD and activating via decorators. |
|
I think this can be done similar like its done in angular. |
Agree |
If so (no |
Is there any updates on this issue? |
It is kind of hard to defined Guards (e.g., AuthGuard) at global level but exclude at specific route with standard @nestjs.
it would be nice if this package provide a way to define
canActivate
with route definition so that we can have some control over customizing enforcing guards declaratively.The text was updated successfully, but these errors were encountered: