netlify / gotrue

An SWT based API for managing users and issuing SWT tokens.
https://www.gotrueapi.org
MIT License
3.82k stars 283 forks source link

Treat function hook 202 as success #264

Closed vbrown608 closed 3 years ago

vbrown608 commented 3 years ago

Background Functions will return a 202 status code and an empty body.

Per https://docs.netlify.com/functions/functions-and-identity/#trigger-serverless-functions-on-identity-events

If you return a status other than 200 or 204 from one of these event functions, the signup or login will be blocked.

We should add 202 (maybe all 200-range statuses?) to the list of status codes we count as success.

vbrown608 commented 3 years ago

We're already supporting 202 here, will work with docs to update the link above. https://github.com/netlify/gotrue/blob/8e05e1e4bb518495f2997b58c06528c8bcc2640c/api/hooks.go#L124