naegelin
11/08/2021, 1:32 AMThe auth.users table has a JSONB column called raw_user_meta_data
however this is problematic because if a new signUp is called on an email address that already exists it will overwrite the metadatasilentworks
11/08/2021, 1:39 AMsilentworks
11/08/2021, 1:39 AMnaegelin
11/08/2021, 1:40 AMnaegelin
11/08/2021, 1:40 AMconst { user, session, error } = await supabase.auth.signUp({
email: email,
password: password,
},{
data:{
phone: phone,
name: name,
company: company
}
})
naegelin
11/08/2021, 1:41 AMsilentworks
11/08/2021, 1:42 AMnaegelin
11/08/2021, 1:43 AMsilentworks
11/08/2021, 1:43 AMsilentworks
11/08/2021, 1:44 AMmetadata
object, but rather use it as a transport object, it's best to write that data to a table as soon as possiblenaegelin
11/08/2021, 1:44 AMsilentworks
11/08/2021, 1:45 AMnaegelin
11/08/2021, 1:46 AMsilentworks
11/08/2021, 1:47 AMnaegelin
11/08/2021, 1:47 AMsilentworks
11/08/2021, 1:47 AMnaegelin
11/08/2021, 1:54 AMsilentworks
11/08/2021, 2:09 AMsilentworks
11/08/2021, 2:09 AMid, email, email_confirmed_at
and then query against thatsilentworks
11/08/2021, 2:11 AMsql
CREATE VIEW public.list_users AS
SELECT id, email, email_confirmed_at
FROM auth.users
silentworks
11/08/2021, 2:13 AMjs
const {data, error} = await supabase.from('list_users').select('*').eq('email', 'email_you_wish_to_check_here');
// now you can check email_confirmed_at inside of data
console.log({ data });
silentworks
11/08/2021, 2:14 AMsilentworks
11/08/2021, 2:15 AMnaegelin
11/08/2021, 2:30 AMsilentworks
11/08/2021, 2:32 AM