Jumper
04/27/2023, 1:10 PMfred kufner
04/27/2023, 1:30 PMjeno
04/27/2023, 1:32 PMππ¬π€ππ« (He/Him)
04/27/2023, 1:54 PMgilbert
04/27/2023, 2:19 PMchats
table. However, when trying to listen for postgres changes, nothing happens when I insert, update, or delete chat records.
1. I have enabled realtime via the ui (see screenshot 1)
2. Replication is enabled (see screenshot 2)
3. The browser user has already successfully authenticated
4. I can query chat rows successfully using the same js client (thus the RLS policy doesn't seem to be the issue)
5. I'm running supabase locally
6. The websocket in the browser connects successfully
Here is my listening code:
const channel = supabase
.channel('table-db-changes')
.on(
'postgres_changes',
{
event: '*',
schema: 'public',
table: 'chats',
},
(payload) => console.log('CHANGE', payload)
)
.subscribe()
What can I do to debug? I would expect this simple case to work easily, so I must be doing something wrong.
https://cdn.discordapp.com/attachments/1101150624663490570/1101150624915128411/Screenshot_2023-04-27_at_9.10.02_AM.pngβΎ
https://cdn.discordapp.com/attachments/1101150624663490570/1101150625191964773/Screenshot_2023-04-27_at_9.11.00_AM.pngβΎ
mdhippie
04/27/2023, 3:06 PMvinciarts
04/27/2023, 3:08 PMKelsieMurphy
04/27/2023, 4:00 PMhttps://cdn.discordapp.com/attachments/1101176118486253629/1101176119534821568/Screenshot_2023-04-27_at_16.57.48.pngβΎ
brainborne
04/27/2023, 4:05 PMrjdavis
04/27/2023, 4:16 PMven
04/27/2023, 4:21 PM{
"imports": {
"/": "./",
"./": "./",
"server": "https://deno.land/std@0.168.0/http/server.ts",
"@supabase/supabase-js": "https://esm.sh/@supabase/supabase-js@2",
"assert": "https://deno.land/std@0.184.0/testing/asserts.ts"
}
}
but i get the error. help appreciated. tia
https://cdn.discordapp.com/attachments/1101181392529920133/1101181393180053514/import_error.pngβΎ
Vik
04/27/2023, 4:25 PMprofile_id
is a foreign key to the auth.users
table. Based on my RLS, if the auth.uid() = profile_id
the are allowed to update their profile information.
Should I also include a trigger function that runs before each update to ensure no malicious users update their profile_id
to someone else's or do something wrong? Is this overkill or something valid I should include.formigueiro
04/27/2023, 5:41 PMjs
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'twitch'
options: {
scopes: '....'
}
})
const oAuthToken = data.session.provider_token
after I click to log in, it goes to the redirect page and when I come back I don't have access to the datalukas.
04/27/2023, 5:56 PMtobowers | Crypto Colosseum
04/27/2023, 6:01 PMthefreedompeople
04/27/2023, 6:18 PMpippin_mole
04/27/2023, 6:38 PMsten
04/27/2023, 7:03 PMmdhippie
04/27/2023, 8:08 PM@supabase/auth-ui-react
UI and when I click on the Discord button it redirects me to discord login and everything works fine. But when I click on authorize
I get redirected back to the page where I signed in from (localhost:3000) and nothing happens. I am not authenticated and there is no user entry in my DB. I can see some new searchparams have been added to my URL though
http://localhost:3000/en?code=0ou3xCzrKT4JsSkkNlbJaNMBrtDnEL&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODI2MjYyMjYsInNpdGVfdXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwIiwiaWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJmdW5jdGlvbl9ob29rcyI6bnVsbCwicHJvdmlkZXIiOiJkaXNjb3JkIiwicmVmZXJyZXIiOiJodHRwOi8vbG9jYWxob3N0OjU0MzIzL2F1dGgvdjEvY2FsbGJhY2sifQ.lQWi1bwjERN8HBvlf7rW4AwhQgqvXXpDFZUsWX4pS-M
I have tried setting the redirectTo
to something else but it's always redirecting me to the page where I signed in from.
tsx
<Auth
supabaseClient={db}
appearance={{ theme: ThemeSupa }}
providers={['discord']}
redirectTo="http://localhost:54323/auth/v1/callback"
/>
I couldn't find my answer in the docs. There is very little useful information regarding auth tbh and it's very scattered/unfocused π¦MrAmG17
04/27/2023, 8:13 PMSELECT count(*) FROM pg_stat_activity WHERE datname = current_database();
shows 7
is this a normal behavior?
https://cdn.discordapp.com/attachments/1101239703245693068/1101239703522521098/image.pngβΎ
sweetamino
04/27/2023, 8:28 PMgtims123
04/27/2023, 8:58 PM*ansible
04/27/2023, 8:52 PMKcrik
04/28/2023, 10:44 AMosamita
04/27/2023, 9:40 PMπ²ππππ
04/27/2023, 11:25 PMcreate or replace function meal_order(a int) returns void as $$
select (select users where uuid = caller.uuid) || ' called, he wants, ' || a || ' burgers.';
$$ language sql;
The expected output is "Johnny Boy called, he wants 4 burgers."
I am aware of how to pass the user id from client. What I want is a way for "caller.uuid" to get the UUID without it being passed into the funtion itself.wzlz
04/27/2023, 11:45 PMostoto
04/28/2023, 2:09 AMgutsyphilip
04/28/2023, 3:06 AMMirik
04/28/2023, 8:47 AM