DarrenJr
12/12/2021, 7:49 PMcodesalim
12/12/2021, 7:58 PMgaryaustin
12/12/2021, 8:03 PMulisses
12/13/2021, 12:04 AMjs
const result = await supabase.auth.signUp({ email, password }, {
data: { type: 1 }
})
The function:
sql
CREATE OR REPLACE FUNCTION create_profile_for_user()
RETURNS TRIGGER AS $body$
BEGIN
IF (NEW.raw_user_meta_data->>'type')::integer NOT IN (1, 2, 3) THEN
RAISE EXCEPTION 'Invalid account type %', NEW.raw_user_meta_data->>'type';
END IF;
INSERT INTO public.profile (id, type)
VALUES (NEW.id, (NEW.raw_user_meta_data->>'type')::integer);
return NEW;
END;
$body$ LANGUAGE plpgsql;
Can someone help me debug the function?garyaustin
12/13/2021, 12:24 AMkroket
12/13/2021, 3:26 AMsql
CREATE OR REPLACE FUNCTION create_profile_for_user()
RETURNS TRIGGER AS $body$
BEGIN
IF (NEW.raw_user_meta_data->>'type')::integer NOT IN (1, 2, 3) THEN
RAISE EXCEPTION 'Invalid account type %', NEW.raw_user_meta_data->>'type';
END IF;
INSERT INTO public.profile (id, type)
VALUES (NEW.id, (NEW.raw_user_meta_data->>'type')::integer);
return NEW;
END;
$body$ LANGUAGE plpgsql security definer;
ulisses
12/13/2021, 9:02 AMegnus
12/13/2021, 10:08 AMdcuk89
12/13/2021, 11:04 AMsilentworks
12/13/2021, 11:53 AMTremalJack
12/13/2021, 1:19 PMTremalJack
12/13/2021, 1:22 PMTremalJack
12/13/2021, 1:24 PMkroket
12/13/2021, 1:26 PMjs
localStorage.removeItem("supabase.auth.token");
jjj.westra
12/13/2021, 2:42 PM{
"message": "no Route matched with those values"
}
For facebook, it redirects correctly but is not logged in; the log says:
error: server_error
error_description: Unable to exchange external code: AQBQUHP_BLABLABLA.LONGCODE
jjj.westra
12/13/2021, 2:42 PMTremalJack
12/13/2021, 2:50 PMMuphet
12/13/2021, 4:45 PMMuphet
12/13/2021, 4:45 PMMuphet
12/13/2021, 4:46 PMScott P
12/13/2021, 5:05 PMjbergius
12/13/2021, 7:07 PMDevilsBlade0
12/13/2021, 9:18 PMDevilsBlade0
12/13/2021, 9:25 PMDevilsBlade0
12/13/2021, 9:31 PMwiesson
12/13/2021, 10:12 PMsupabaseAdmin.auth.api.createUser({
email: authUser.email,
data: {
...firebaseUserData
}
})
I checked https://supabase.com/docs/reference/javascript/auth-api-createuser but the docs only mention a "name" field? I checked the Typescript types as well, but I still don't know where I should add. the phone number. It also looks like, the mentioned data object doesn't work at all (at least I can't find it in the db)kennethcassel
12/13/2021, 10:39 PMAnt
12/14/2021, 1:44 AMSophic
12/14/2021, 3:39 AM604800
on supabase auth settings. However, the session I am getting back still has an expires_at
and expires_in
as if it were 3600
I may just be missing something. I was however using those values to determine when to call refreshSession
kroket
12/14/2021, 5:27 AM