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

Instrumentation of NestJS guards #13078

Closed
Tracked by #12504
nicohrubec opened this issue Jul 29, 2024 · 0 comments · Fixed by #13129
Closed
Tracked by #12504

Instrumentation of NestJS guards #13078

nicohrubec opened this issue Jul 29, 2024 · 0 comments · Fixed by #13129
Assignees
Labels
Package: nestjs Issues related to the Sentry Nestjs SDK

Comments

@nicohrubec
Copy link
Contributor

nicohrubec commented Jul 29, 2024

https://docs.nestjs.com/guards

Solution: According to the docs guards are annotated with @Injectable and implement a canActivate method. So we can use that to hook into the framework.

Limitation: Although the nest docs say that guards should always have an @Injectable decorator, guards work just fine without it unless it has dependencies on other services.

@nicohrubec nicohrubec self-assigned this Jul 29, 2024
@nicohrubec nicohrubec added the Package: nestjs Issues related to the Sentry Nestjs SDK label Jul 29, 2024
@nicohrubec nicohrubec linked a pull request Jul 31, 2024 that will close this issue
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nestjs Issues related to the Sentry Nestjs SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant