raae (queen.raae.codes)
08/24/2022, 6:17 PMMax52
08/24/2022, 6:29 PM{category_id: category}
and if category is null, the column stays null. The issue is I get an error stating that it cannot be inserted as a uuid. Thoughts?Joyboy
08/24/2022, 9:19 PMFran Mella
08/24/2022, 9:47 PMfernandops26
08/24/2022, 10:43 PMjs
// credentials object is an object containing the access_token, refresh_token created from the URL Fragment
// trying do a signIn
const data = await supabaseClient.auth.signIn({
refreshToken: credentials.refresh_token,
})
I am doing it according to this example on React Native but in VSCode: https://supabase.com/docs/reference/javascript/auth-signin#sign-in-using-a-refresh-token-eg-in-react-native
But, I did receive the Request Failed
message on the data
object:
json
{
"user": null,
"session": null,
"error": {
"message": "Request Failed"
}
}
BTW I am using the supabase-js
client V1.sb
08/24/2022, 10:58 PM7seas3c
08/25/2022, 3:33 AMsupabase-js
library and I wanna listen to every events on every table
js
const socket = new RealtimeClient(process.env.REALTIME_URL, {
params: {
apikey: process.env.REALTIME_API_KEY
}
})
socket.connect()
const PTListener = socket.channel('realtime:public:*')
// BUG only DELETE works
PTListener.on('INSERT', (change) => {
console.log('INSERT on PTListener', change)
})
PTListener.on('UPDATE', (change) => {
console.log('UPDATE on PTListener', change)
})
PTListener.on('DELETE', (change) => {
console.log('DELETE on PTListener', change)
})
but only only trigger on DELETE
, but not on INSERT
or UPDATE
.fernandops26
08/25/2022, 5:37 AMrefresh_token
from an already logged user using supabaseClient.auth.session()
when load the page but doesn't return that value.
This is the code
js
import { supabaseClient } from '@supabase/supabase-auth-helpers/nextjs';
import { useUser } from '@supabase/supabase-auth-helpers/react';
const Onboarding = () => {
const { user } = useUser();
...
useEffect(() => {
if (user) {
console.log('session: ', supabaseClient.auth.session());
...
}
The value displayed is:
json
{
"access_token": "user.jwt.tokenxxxx",
"token_type": "bearer",
"user": null
}
Why I can't access the refresh token?Thoth Trismegistus
08/25/2022, 5:48 AMZapuzu
08/25/2022, 5:59 AMDeleted User
08/25/2022, 7:39 AMalx90
08/25/2022, 1:06 PM[
{
"name": "Hero",
"fields": {
"btn_left": {
"text": "Get started",
"link": "/"
},
"btn_right": {
"text": "Learn more",
"link": "/"
}
}
},
]
Into a json supabase column via the supabase gui?
Thanks for reply guys β€οΈmagicbyt3
08/25/2022, 1:12 PMMax52
08/25/2022, 1:37 PM.eq("tag", null)
when the match case is null, that way I get all posts instead of none.elhe26
08/25/2022, 1:44 PM{
code: '22P02',
details: null,
hint: null,
message: 'invalid input syntax for type bigint: ""'
}
SeΓ±or Bruno
08/25/2022, 3:22 PMdevstojko
08/25/2022, 4:25 PMbegin
insert into public.profiles(id, username)
values(new.id, new.user_metadata.username);
return new;
end;
This doesn't work. It says that user_metadata doesn't exist in new.
On signUp, I send data: { username }Jenaro Calvino
08/25/2022, 5:04 PMbash
pg_dump: error: connection to server at "ec2-54-224-120-186.compute-1.amazonaws.com" (54.224.120.186), port 5432 failed: SSL error: certificate verify failed
connection to server at "ec2-54-224-120-186.compute-1.amazonaws.com" (54.224.120.186), port 5432 failed: FATAL: no pg_hba.conf entry for host "152.171.245.125", user "myuser", database "mydb", SSL off
I'm wondering how to force SSL and how to get the cert for that matter, I don't know where on heroku that's supposed to be, thank you so muchlukehennerley
08/25/2022, 5:53 PMrc
of Supabase to use the new auth component, unfortunately, now I get the error attached in the image.
I am not doing anything complicated, my supabaseClient.ts
looks like this (ignore the keys I have them correctly being passed):
import { createClient } from '@supabase/supabase-js';
// Create a single supabase client for interacting with your database
export const supabase = createClient(
'https://xyzcompany.supabase.co',
'public-anon-key',
);
Login.tsx looks like this:
import { supabase } from '@/utils/supabaseClient';
import { Auth, ThemeSupa } from '@supabase/auth-ui-react';
import React, { useState } from 'react';
const Login = () => <Auth supabaseClient={supabase} />;
export default Login;
This is on version 12.2.2 of NextJS - any ideas? I haven't messed around in the web world for a long time so I am guessing it might be something in my tsconfig that I am missing blindly.Max52
08/25/2022, 7:18 PMsql
(has_course(( SELECT course_id
FROM thread
WHERE (thread_id = id)), uid()) AND (user_id = uid()))
However when I save and try it, I get an RLS error. Then when I go into the policy editor, it changes to:
sql
(has_course(( SELECT thread.course_id
FROM thread
WHERE (reply.thread_id = thread.id)), uid()) AND (user_id = uid()))
Which might just be a more explicit version that Supabase automatically updates to? Either way, I can't seem to get this policy working right.RogerThis
08/25/2022, 8:38 PMSwapnil
08/25/2022, 9:26 PMtheuknowner
08/25/2022, 10:56 PMlucasb
08/26/2022, 3:44 AMcreate policy "Users can update own profile."
on profiles for update
using ( auth.uid() = id );
using this update statement with the supabase js client:
const { data, error } = await supabase
.from('profiles')
.update({
...formValues,
})
.match({ id: user?.id });
any idea why? This is on a nextjs page where the user is authenticatedZozo
08/26/2022, 8:18 AMSanctus
08/26/2022, 9:11 AMts
const { data, error } = await supabase
.from(health_facilities)
.select('*, health_facility_categories!inner(*)')
.eq('health_facility_categories.name', 'clinic')
Now, in my health_facilities table I have a city_id column with a foreign key to the cities table.
How can I replace the city_id with the cities.name in my result?sinnvoller
08/26/2022, 9:41 AMTARS
08/26/2022, 11:23 AM[
"{\"id\":\"hostpictureupload/hjpxjha1tyysgnwi9w9z\",\"url\":\"https://res.cloudinary.com/duj052tmt/image/upload/v1661512384/hostpictureupload/hjpxjha1tyysgnwi9w9z.jpg\"}",
"{\"id\":\"hostpictureupload/irrxsmu6ri6u9k0ibcgp\",\"url\":\"https://res.cloudinary.com/duj052tmt/image/upload/v1661512384/hostpictureupload/irrxsmu6ri6u9k0ibcgp.jpg\"}",
"{\"id\":\"hostpictureupload/uzk1fmgoygeq3m2qxjlh\",\"url\":\"https://res.cloudinary.com/duj052tmt/image/upload/v1661512384/hostpictureupload/uzk1fmgoygeq3m2qxjlh.jpg\"}"
]
Why are there \ ?Abulmagd
08/26/2022, 11:38 AM