docs.nestjs.com
docs.nestjs.com copied to clipboard
docs(guards): Add missing imports and fix information content
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/nestjs/docs.nestjs.com/blob/master/CONTRIBUTING.md
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
- [x] Docs
- [ ] Other... Please describe:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
I feel that the line
import { validateRequest } from 'custom-authorization'
could confuse people. What if someone publish a package calledcustom-authorization
?Also, the snippet below
@@switch
line is the JS version.
Modified the example import statement towards local file which should not prevent confusion in the readers.
Also moved the definition of the request in the typescript version (before the @@switch
)
could you please fix L11 as well?
https://github.com/Daniel-Yonkov/docs.nestjs.com/blob/cc470436fde8189e56a58d30a3d55f4a647af5e5/content/guards.md?#L11
should be
> info **Hint** Guards are executed **all** middleware, but **before** any interceptor or pipe.
@micalevisk
> info **Hint** Guards are executed **all** middleware, but **before** any interceptor or pipe.
I am not sure I understand what is implied in this info - Does this mean that Guards are executed after all middleware or before them or are executed before/after the middleware defined in a dependency chain during runtime?
@Daniel-Yonkov my bad, should be:
> info **Hint** Guards are executed **after** all middlewares, but **before** any interceptor or pipe. More on this [here](https://docs.nestjs.com/faq/request-lifecycle#summary).
@micalevisk - Addressed