Skip to content

Handle non-success responses for webhooks using the better-auth adapter #173

@MarcMogdanz

Description

@MarcMogdanz

Currently there seems to be no proper way to return a non-200 response on a webhook endpoint.
Ideally you could return a body with a specific http status code, something along the lines of the Response.json() function for remix.

An alternative approach that I think would also be enough and quicker to implement would be to catch all errors being thrown in a webhook handler and just return a 500 back. Lacks the option to explicitly specify the http code, but it allows to at least differentiate between success and error cases for the response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions