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

[Docs]: Webhook instructions for Clerk don't work on Vercel #6386

Closed
1 task done
skyriverbend opened this issue Sep 14, 2022 · 3 comments
Closed
1 task done

[Docs]: Webhook instructions for Clerk don't work on Vercel #6386

skyriverbend opened this issue Sep 14, 2022 · 3 comments

Comments

@skyriverbend
Copy link

Summary and description

These instructions on integrating Clerk webhooks don't work when deploying to Vercel:
https://redwoodjs.com/docs/webhooks#base64-sha256-verifier-used-by-svix-clerk

It ends up throwing WebhookVerificationError. The instructions do, however, work on Netlify.

I believe this may have to do with Vercel somehow pre-parsing and modifying the body.

Are you interested in working on this?

  • I'm interested in working on this
@redwoodjs-bot redwoodjs-bot bot added this to Main Sep 14, 2022
@redwoodjs-bot redwoodjs-bot bot moved this to Triage in Main Sep 14, 2022
@simoncrypta simoncrypta moved this from Triage to Backlog in Main Sep 30, 2022
@simoncrypta
Copy link
Collaborator

Hi @jonlemmon Thank you for open this issue.
If you need any help for working on it, don't hesitate to ask :)

@simoncrypta simoncrypta removed their assignment Dec 9, 2022
@tmikeschu
Copy link
Contributor

@skyriverbend I got it working in vercel with a fix from this issue:

#1410 (comment)

export const handler = async (event: APIGatewayEvent) => {
  const clerkInfo = { webhook: 'clerk' }
  const webhookLogger = logger.child({ clerkInfo })
  const body = event.isBase64Encoded
    ? Buffer.from(event.body, 'base64').toString('utf-8')
    : event.body
  ...

@dac09
Copy link
Contributor

dac09 commented Dec 1, 2023

Closing the issue, as suggested solution from @tmikeschu looks to me the probable cause.

Feel free to re-open if I'm mistaken :)

@dac09 dac09 closed this as completed Dec 1, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in Main Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants