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

feat(websockets): global guards are called in websocket too #11462

Closed

Conversation

Maligosus
Copy link

@Maligosus Maligosus commented Apr 13, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #11461

What is the new behavior?

Global guards are called too in @nestjs/websockets. It's optional and don't called, if we don't enable globalGuards for websocket.
Resolve #11461

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@Maligosus
Copy link
Author

Maligosus commented Apr 13, 2023

I can add an option to enable or disable the global config for the WebSocketModule. Because if we do not add it, then we can break someone's application.

@Maligosus
Copy link
Author

Maligosus commented Apr 13, 2023

I can add an option to enable or disable the global config for the WebSocketModule. Because if we do not add it, then we can break someone's application.

I add this options. And this PR not break other projects.

If you want to use global pipes,interceptors, guards for gateways, you should call

app.applyApplicationConfigToWs();

@Maligosus Maligosus changed the title fix(websockets): global guards are called in websocket too feat(websockets): global guards are called in websocket too Apr 13, 2023
@kamilmysliwiec
Copy link
Member

#11461 (comment)

@nestjs nestjs locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global guards in @nestjs/websockets
2 participants