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

Access controller/method in context #57

Closed
Sorikairox opened this issue Nov 11, 2022 · 0 comments
Closed

Access controller/method in context #57

Sorikairox opened this issue Nov 11, 2022 · 0 comments
Assignees
Labels
feature New feature good first issue Good for newcomers

Comments

@Sorikairox
Copy link
Collaborator

Sorikairox commented Nov 11, 2022

Is your feature request related to a problem? Please describe.

Let's say I have a global AuthGuard because almost all my routes need authentication.
The few that don't need it should have a decorator such as @Public that set metadata.

In my global AuthGuard, I should be able to get a reference to the Method (via ctx) to get access to its metadata.

Describe the solution you'd like

In router/router.ts:handleRoute, we should add Controller and ControllerMethod in ctx !

Additional context

Maybe something similar to NestJS

 ctx.getHandler(),
 ctx.getClass(),
@Sorikairox Sorikairox changed the title Access controlle/method in context Access controller/method in context Nov 11, 2022
@Sorikairox Sorikairox added feature New feature good first issue Good for newcomers labels Nov 11, 2022
@Sorikairox Sorikairox self-assigned this Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant