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

Fix onRequest hook documentation #302

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Fix onRequest hook documentation #302

merged 3 commits into from
Oct 4, 2023

Conversation

mattiapv
Copy link
Contributor

@mattiapv mattiapv commented Aug 9, 2023

Added missing async and await keywords, try...catch block. This prevents server crashes caused by missing await on jwtVerify() function.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of this are needed, why did you add them?

@mattiapv
Copy link
Contributor Author

mattiapv commented Aug 10, 2023

None of this are needed, why did you add them?

Because without awaiting jwtVerify() the server crash.

You can try the cookie or the onlyCookie example.

If you make a call to http://localhost:3000/verifyCookie the server crash.

If I add await request.jwtVerify(), I receive the correct error (FST_JWT_NO_AUTHORIZATION_IN_HEADER) and the server doesn't crash.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 9509420 into fastify:master Oct 4, 2023
@Fdawgs Fdawgs mentioned this pull request Oct 4, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants