-
Notifications
You must be signed in to change notification settings - Fork 35
docs: Add Nuxt payload verification example #200
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Deployment failed with the following error:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
|
||
export default defineEventHandler(async (event) => { | ||
const headers = getRequestHeaders(event); | ||
const payload = await readBody(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find documentation on readBody
, I didn't find a definitive reference but a few hints like https://www.reddit.com/r/Nuxt/comments/1aowr1p/access_raw_body_of_stripe_event/ that say that it parses the request body. It is important that the payload passed to wh.verify
is the raw body. The suggestion from the linked reddit thread is to use readRawBody
, can you verify that the following works in your codebase?
const payload = await readBody(event); | |
const payload = await readRawBody(event); |
No description provided.