Skip to content
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

@AuthException() unsecure a specific route. #696

Closed
menme95 opened this issue May 16, 2018 · 5 comments
Closed

@AuthException() unsecure a specific route. #696

menme95 opened this issue May 16, 2018 · 5 comments

Comments

@menme95
Copy link

menme95 commented May 16, 2018

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ X ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I have all my routes secured.

app.useGlobalGuards(new (AuthGuard('jwt'))());

Expected behavior

It could be usefull have a decorator: @AuthException() wich unsecure a route.

What is the motivation / use case for changing the behavior?

If you have a completely private api and you want to unsecure authenticate route

Environment


[System Information]
OS Version     : Windows 7
NodeJS Version : v10.0.0
NPM Version    : 6.0.0
[Nest Information]
microservices version : *
websockets version    : *
mongoose version      : 4.0.0
passport version      : 1.0.10
swagger version       : 2.0.0
testing version       : *
common version        : *
core version          : *

@AntoineMaitre
Copy link

One solution you can try would be to use your AuthGuard at the controller level.
In the controller where you need to remove the auth restriction, use AuthGuard at the route level, so that your unrestricted route doesn't have the AuthGuard.

@menme95
Copy link
Author

menme95 commented May 18, 2018

I have two controller, one with guard and other one without it but it is not exactly what I want to do. This is a heritable big project and I need to do this as simple as I am able to do.
My others apps are with GlobalGuards and I'm trying to keep the same architecture.
I will try a custom decorator but I don't know if it will be posible

@kamilmysliwiec
Copy link
Member

This feature would make it possible. Let's track this issue, this is something that I definitely want to do in the near future.

@mazyvan
Copy link

mazyvan commented Jan 23, 2019

Any advances on this feature?

@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants