netlify-labs / react-netlify-identity

a tiny (4kb) React hook for using Netlify Identity, no UI. SEEKING MAINTAINERS
https://netlify-gotrue-in-react.netlify.com/
156 stars 25 forks source link

Issues confirming emails #16

Closed ChristienGuy closed 5 years ago

ChristienGuy commented 5 years ago

As far as I understand it the hook handles email confirmation by default and it appears to be trying to but failing.

From what I can tell runRoutes correctly identifies the confirmation route and calls gotrue.confirm but somewhere within that call an error occurs.

The error logged is Error in confirm call JSONHTTPError: Failed to handle signup webhook.

swyxio commented 5 years ago

thanks for the report. i've never seen that error before. it must come from lower down the stack. any thoughts on how to repro?

ChristienGuy commented 5 years ago

Cheers for the reply! I managed to track down where this error is getting thrown here: https://github.com/netlify/gotrue/blob/master/api/hooks.go#L137

That said tho, I tried to repro it with a fresh netlify site and I can't seem to reproduce it, so it seems like it's an issue with the specific instance I'm trying to run it against.

I'll try my code against a fresh site later and see if I run into the same issue.

ChristienGuy commented 5 years ago

It seems to have become resolved on the original site I was having trouble with.

I'm not totally sure what happened there but at least we know it wasn't an issue with this library, and it works so 🙌

swyxio commented 5 years ago

weiiird

cheers

prs and docs welcome if you felt anything could be better of course. this is just something i'm doing on the side and doesnt get as much love as it ought to

ChristienGuy commented 5 years ago

I think I've discovered the core of the problem! It was very much a me problem.

I had a serverless function identity-signup that was actually broken and I didn't realise that this function name essentially registers as a webhook (which makes sense when I stop and think about it).

So because that function was broken it was causing identity to break entirely when trying to singup and confirm emails.

swyxio commented 5 years ago

ah.

btw we recently added https://github.com/netlify/netlify-dev-plugin/pull/213 which helps with local test and development of serverless functions. havent done much publicity or stress testing yet but see if it helps you catch these sooner (in particular, intentionally write a broken function and then run netlify functions:invoke on it)

meronek commented 4 years ago

I had the same "failed to handle signup webhook" error message suddenly appearing. It was after I had started messing with the identity-signup webhook. I added that function in my app, then deleted it, and that's when I started getting the error. I put the function back and now signupUser works again.

Just throwing this in here in case it helps someone else out.

swyxio commented 4 years ago

file a new issue if it could be better, im not particularly working on this right now but i’ll take pr’s and repro cases