Vik
03/21/2023, 1:00 AMavatars
is a public bucket and these are the security policies.
SELECT
((bucket_id = 'avatars'::text) AND true)
DELETE
((bucket_id = 'avatars'::text) AND ((auth.uid())::text = (storage.foldername(name))[1]))
INSERT
((bucket_id = 'avatars'::text) AND ((auth.uid())::text = (storage.foldername(name))[1]))
UPDATE
((bucket_id = 'avatars'::text) AND ((auth.uid())::text = (storage.foldername(name))[1]))
Mai | GMT+8
03/21/2023, 2:31 AMJinni
03/21/2023, 5:33 AMdb push
) after merging the develop branch to main branch.
Can someone explain what could be the problems? What happens if db push fails and the code got merged? Is there a downtime?AntDX316
03/21/2023, 7:56 AMAissam
03/21/2023, 8:02 AMSaad
03/21/2023, 8:41 AMsinrabo
03/21/2023, 8:43 AMjimbo123
03/21/2023, 9:22 AM(auth.uid() = user_id)
I'm passing user_id
from the client with supabase.from("mytable").insert({ name: "foo", user_id: state.id });
This is working but it feels redundant to store the user's ID in application state given its already part of the authentication system. Is my approach considered best practice or is there a better way?kresimirgalic
03/21/2023, 9:29 AMconst { data, error } = await supabase.auth.signInWithOtp({
phone,
options: {
shouldCreateUser: false
},
});
Phone param is coming from the function i am calling, so you got the point. This issue is really crucial for the app i am doing right now, and i didnt found the answer.
Do i need to setup something in the dashboard?
I am using this version "@supabase/supabase-js": "^2.12.0",STILLWATER;
03/21/2023, 10:13 AMVimes
03/21/2023, 10:56 AMjs
const accessToken = router.query.access_token as string;
const supabase = useSupabaseClient();
const supaResett: SubmitHandler<FormValues> = async ({ password }) => {
console.log("Inni supareset");
supabase.auth
.updateUser(accessToken, { password }) <- TS says I can't use accessToken here
.then(() => {
console.log("User password updated");
})
.catch(() => {
console.log("Feila Γ₯ oppdatere bruker passord");
setState("default");
});
return <p>Test</p>;
};
sleepyhairman
03/21/2023, 10:58 AMCadavreux
03/21/2023, 11:01 AMbono
03/21/2023, 11:15 AMjavascript
forgotPassword: async ({ email }) => {
const { error } = await supabaseClient.auth.resetPasswordForEmail(
email, { redirectTo: "http://localhost:3000/update-password" }
);
if (error) {
return {
success: false,
error,
};
}
return {
success: true,
};
},
updatePassword: async ({ newPassword }) => {
const { data, error } = await supabaseClient.auth.updateUser({ password: newPassword, });
if (error) {
return {
success: false,
error,
};
}
return {
success: true,
redirectTo: "/",
};
}
MrWhite
03/21/2023, 1:18 PMDan Rumney
03/21/2023, 1:37 PMlake_mattiato
03/21/2023, 1:51 PMNJβ’
03/21/2023, 2:26 PMYourAverageTechBro
03/21/2023, 2:32 PMabc.com/auth?state=abc
to sign up for an account
2) On successful sign up, the user is redirected to abc.om/auth#
Desired behavior:
1) User goes to abc.com/auth?state=abc
to sign up for an account
2) On successful sign up the user is redirect to abc.com/auth?state=abc
In the auth process is there any way to send the stateId
in the sign up process for social auth (primarily Google, FB, Apple) as well as email sign up?ffkml
03/21/2023, 2:43 PMsupabase-js
which seem to look like connection issues between the postgrest
container and the postgres
container.
## To Reproduce
I'm running a self-hosted docker instance of Supabase. Some requests come back with the following errors:
{ code: '', details: null, hint: null, message: '' }
{
code: 'PGRST001',
details: 'no connection to the server\n',
hint: null,
message: 'Database client error. Retrying the connection.'
}
Looking at the logs for PostgREST I saw the following:
09/Mar/2023:13:12:17 +0000: Attempting to connect to the database...
10.0.12.24 - service_role [09/Mar/2023:13:12:17 +0000] "POST /foo_table HTTP/1.1" 503 - "" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
## System information
- OS: Alpine Linux / Docker
- Version of supabase-js: 2.10.0
- Version of Node.js: 16
## Additional context
FWIW - I've also seen some console errors in the UI portion of the app that also have 503 codes related to supabase queries/operations. I suspect these are related.Ames Dean
03/21/2023, 3:04 PM| Json[]
.
When this is removed, the error disappears with seemingly no side effects.
Does anyone happen to have any insight into this?
Thanks!
JimTerminal
03/21/2023, 3:20 PMsome_connections
which has RLS enabled with a policy
SQL
CREATE POLICY "Enable all acitons for authenticated users only" ON "public"."some_connections"
AS PERMISSIVE FOR ALL
TO authenticated
USING (true)
WITH CHECK (true)
However, when calling await supabase.from('some_connections').insert(someConnectionDetails);
I am receiving
{
error: {
code: '42501',
details: null,
hint: null,
message: 'permission denied for function crypto_aead_det_encrypt'
},
data: null,
count: null,
status: 403,
statusText: 'Forbidden'
}
On this table I am also using pgsodium to perform cell encryption with a trigger on a column key_id
sql
DECLARE
key_record pgsodium.valid_key%ROWTYPE;
BEGIN
SELECT * INTO key_record FROM pgsodium.create_key();
RETURN key_record.id;
END;
What might be causing this permission denied errorQuazar
03/21/2023, 3:54 PMsupabase link --project-ref <your-project-ref>
Will eventually figure it out eventually but could use some help. Thanks!rbl
03/21/2023, 4:16 PMjsonb
and I update it with a json object. Realtime isn't firing an update on the json change. It also doesn't return back jsonb columns in the insert as well.Paradox
03/21/2023, 4:35 PMFailed to run sql query: operator does not exist: uuid = bigint
I want to simply allow all registered users to be able to create messages, read and update them.
SQL isn't my strongest point and I'm new to Supabase but I can't seem to work out why this is throwing the error, are you not allowed to use the ID for the user that has a Data Type of bigint
in this way?
sql
create policy "Allow logged in read access" on public.messages using (auth.role() = 'authenticated');
create policy "Allow individual insert access" on public.messages for insert with check ( auth.uid() = id );
create policy "Allow individual update access" on public.messages for update using (auth.uid() = id )
πππππππππ | Drooler
03/21/2023, 5:06 PMflorian.megamind.solutions
03/21/2023, 5:08 PMRytterboi
03/21/2023, 5:10 PMbattlesheep123
03/21/2023, 5:20 PMpakkerr
03/21/2023, 5:21 PM