vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.65k stars 1.36k forks source link

Supabase not saving full_name when user signs up #92

Closed danidz96 closed 2 years ago

danidz96 commented 2 years ago

Hi! I was doing a project on my own and when trying to update the users table it gives a 404 supabase error. I have seen that it happens to more people but I cannot see why, it seems that it is related to the policies of the table, but I have tried everything and nothing works.

Desperate I have created a new project in supabase, I have cloned this repo and executed the SQL schema, but it also gives the same error.

image image image

I also tried with Postman but returns the same error. Maybe is a bug with supabase or something bad configured.

Update: I disabled Row Level Policy and it worked but that's not secure

Someone else happens?

davevanhoorn commented 2 years ago

By default the Supabase signUp function doesn't return a user session. Without a user session the Row Level Security will prevent any updates to the data. Supabase wants the user to confirm their email first - then it'll return a user session.

Quick fix Go to your Supabase admin panel -> Authentication -> Settings and disable Enable email confirmations. Once disabled the signUp function returns a user session (with which you can update the data).

Read the signUp notes here

danidz96 commented 2 years ago

Oh, thank you. My bad... Is my first time with supabase and I didn't realize that