-
-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Description
I created a stored procedure (aka function) in the database that I hoped would allow the user's email address to be updated from the supabase JS client. When I ran it, I was met with an error message: 'permission denied for schema auth'
Here's what my 'CREATE FUNCTION' query looks like:
CREATE FUNCTION updateauthemail (new_email text, auth_id text)
RETURNS text AS $updated_data$
DECLARE
updated_data text;
BEGIN
UPDATE auth.users set email = new_email where id = auth_id;
RETURN updated_data;
END;
$updated_data$ LANGUAGE plpgsql;
Do I need to add something to the function when creating it, or pass a certain param through the JS client on my Node.js server? Here's the function I'm calling through the JS client:
const { data: rpcData, error: rpcErr } = await supabase.rpc(
"updateauthemail",
{
auth_id: authId,
new_email: updatedData.email,
}
);
Originally posted by @dayvista in supabase/supabase#573 (reply in thread)
Metadata
Metadata
Assignees
Labels
No labels