user
08/15/2021, 2:41 PMauth.signUp
?
I'm reading this: https://supabase.io/docs/reference/javascript/auth-signupromlytech
08/15/2021, 2:43 PMuser
08/15/2021, 2:43 PMromlytech
08/15/2021, 2:45 PMauth.users
table is not exposed to the public api. Take alook at this guide: https://supabase.io/docs/guides/auth/managing-user-dataromlytech
08/15/2021, 2:46 PMuser
08/15/2021, 2:49 PMromlytech
08/15/2021, 2:52 PMOctavianVoss
08/15/2021, 3:07 PMromlytech
08/15/2021, 3:09 PMauth.users
- you are just making another public.profiles
(or whatever you decide to call it) where the primary key is the user's ID from the auth.users
table.romlytech
08/15/2021, 3:10 PMupsert
for the public.profiles
table on my Edit Profile pages and don't worry if they exist or not. The users signup, login then are redirected to the edit profile page.jon.m
08/15/2021, 3:52 PMOctavianVoss
08/15/2021, 4:08 PMOctavianVoss
08/15/2021, 4:08 PMLynqoid
08/15/2021, 4:18 PMjjj.westra
08/15/2021, 5:54 PMjjj.westra
08/15/2021, 5:55 PMjjj.westra
08/15/2021, 5:55 PMjjj.westra
08/15/2021, 5:55 PMjjj.westra
08/15/2021, 5:55 PMjjj.westra
08/15/2021, 5:58 PMfenix
08/15/2021, 7:16 PMNebula
08/15/2021, 7:53 PMAdamo
08/15/2021, 8:52 PMjavascript
import { createClient } from '@supabase/supabase-js';
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseAnonKey = process.env.SUPABASE_ANON_KEY;
export const supabase = createClient(supabaseUrl, supabaseAnonKey);
env
SUPABASE_URL=<url-here>
SUPABASE_ANON_KEY=<key-here>
So I setup the client, but in my NextJS app I keep getting an error
Unhandled Runtime Error
Error: supabaseUrl is required.
What's going on here? When I console.log the url/key they are both being read in properly from the .env file.louis.barclay
08/15/2021, 9:04 PMemail
field to public.users
(which is a table that ships with the starter project). Now, user sign up is failing. I'm getting {message: "Database error saving new user", status: 500}
. This is documented in several GitHub issues for Supabase but the solutions there aren't helping me.
I've tried renaming public.users
to public.accounts
. Also tried deleting the handle_new_user
function that ships with that starter project, since I figured that might be responsible, but I can't. I get an error saying Deleting handle_new_user failed: cannot drop function handle_new_user() because other objects depend on it
. Also tried updating handle_new_user
to the following, where I've added the logic for the new email
field, in case that's the issue:
begin
insert into public.accounts (id, full_name, avatar_url, email)
values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url', new.raw_user_meta_data->>'email');
return new;
end;
The email
field on accounts
is nullable by the way.
Any ideas gratefully appreciated since my SaaS business is totally broken right now, with no one being able to sign up and pay!louis.barclay
08/15/2021, 9:06 PMInviting user failed: Database error saving new user
louis.barclay
08/15/2021, 9:08 PMDROP FUNCTION IF EXISTS handle_new_user cascade;
which was suggested in this GitHub issue: https://github.com/supabase/supabase/issues/563Di
08/15/2021, 10:42 PMDi
08/15/2021, 10:43 PMDi
08/15/2021, 10:55 PMScott P
08/15/2021, 11:46 PM