wiesson
11/25/2021, 10:12 PMimages_image (id, url)
itinerary_image (id, itinerary_id (fk), image_id (fk))
bookings_itinerary (id, ...)
I guess, I could fill the mapping table manually, but is there a helper?Mihai
11/25/2021, 10:59 PMNeucoas
11/26/2021, 12:17 AM401 JWT Expired
errors?
The problem is that when someone leaves the site open on a background tab and comes later, the supabase-js client fails to refresh the JWT; so it makes api requests with tokens that are expired. This means that all requests will fail until either the user refreshes the tab or logs out.Milou
11/26/2021, 1:51 AMMilou
11/26/2021, 1:51 AManothercoder
11/26/2021, 2:21 AMMilou
11/26/2021, 2:21 AMMilou
11/26/2021, 2:22 AManothercoder
11/26/2021, 2:25 AMMilou
11/26/2021, 2:26 AManothercoder
11/26/2021, 2:29 AManothercoder
11/26/2021, 8:58 AMWebSocket connection to 'wss://myproj.supabase.co/realtime/v1/websocket?apikey=XXXXX&vsn=1.0.0' failed:
supa
11/26/2021, 3:37 PMmorenoto
11/26/2021, 4:07 PMbegin
insert into public."Users" (id, email , name, phone_1, phone_2, id_condo, address, birthday, password )
values (
new.id,
new.email,
new.raw_user_meta_data->>'name',
new.raw_user_meta_data->>'phone_1',
new.raw_user_meta_data->>'phone_2',
(new.raw_user_meta_data->>'id_condo'::text)::uuid,
new.raw_user_meta_data->'address',
CAST (new.raw_user_meta_data->>'birthday' as DATE),
crypt(new.password, gen_salt('bf'))
);
return new;
end;
morenoto
11/26/2021, 4:08 PMmorenoto
11/26/2021, 4:09 PMKhan W
11/26/2021, 5:45 PMKhan W
11/26/2021, 5:45 PMralanyo
11/26/2021, 9:52 PM$flight = Flight::where('active', 1)->first();
pedrodiaz
11/26/2021, 10:18 PMralanyo
11/26/2021, 10:27 PMJaeden
11/26/2021, 10:40 PMexport const getListById = async (id) => {
return await supabase
.from('lists')
.select('*, items:list_items(*), creator:profiles(*)')
.eq('id', id)
.single()
}
Afterwards, I subscribe to this table like so:
supabase
.from(`lists:id=eq.${id}`)
.on('*', (payload) => {
switch (payload.eventType) {
case 'INSERT':
console.log(payload.new)
break
case 'UPDATE':
console.log(payload.new) // <--- error below occurs here
return
case 'DELETE':
this.$nuxt.error({ statusCode: 404, message: 'Page not found' })
break
}
})
.subscribe()
I get the following error on UPDATE
Uncaught tried to push 'access_token' to 'realtime:public:profiles' before joining. Use channel.subscribe() before pushing events
`
user
11/27/2021, 6:29 PMMaz
11/27/2021, 10:57 PMtourdownunder
11/27/2021, 11:23 PMsecurity definer
as that will run the function with the user permissions of the function owner / superuser.cookie mob
11/28/2021, 12:57 AMnomac-
11/28/2021, 2:41 AMMaz
11/28/2021, 2:45 AMcreate policy
for some basic select/insert/update restrictions that are basically just (uid() = user_id)
. Will server side database calls always run as superuser? Curious how the library knows whether it's running server side or client side?Maz
11/28/2021, 2:55 AMcreateClient
result, which is using the anon key. So maybe my solution here is to just use a different client with the service key.Maz
11/28/2021, 3:13 AM