netlify / ask-netlify

A place to submit questions for Netlify to answer in tutorials, podcasts and blog posts
https://ask.netlify.com
32 stars 8 forks source link

Identity signup & MongoDB user creation question #20

Closed parkeragee closed 5 years ago

parkeragee commented 5 years ago

About me

Software Engineer for Campaign Monitor & Founder of Sully Labs (my umbrella entity for all of my side projects)

My question in a little more detail

What's the best way to update the user_metadata in Netlify Identity as a response to a identity-signup event?

An identity-signup event only returns the user object and does not include an Identity admin token for updating the user_metadata via GoTrue.

Here's my use-case:

Ideally, I would like to handle updating the user_metadata within that identity-signup.js function right after the user is created in MongoDB.

Thoughts?

philhawksworth commented 5 years ago

Answered in Ep2 - coming soon: https://ask.netlify.com/episode/02/

bristoljon commented 4 years ago

Any chance could get a link to the code repo for the demo?

https://identity-example-update-user.netlify.com/

bristoljon commented 4 years ago

Ok I found this but it inexplicably doesn't have an identity-signup.js function? Perhaps this is explained in the video but was trying to avoid having to watch it all!

https://github.com/netlify/identity-update-user-data

The issue I'm running into is that my identity-signup.js lambda never seems to get called. It shows as a function in the Functions tab of the netlify dashboard but no logs are generated

Bulletninja commented 4 years ago

I have the same issue, my identity-signup.js never gets called 🤔 UPDATE: It seems to be working now. I was under the impression that this also worked locally, but seems like it only works in production. Would be great if it also worked locally. That way we could test before deploying anything