Tonic
02/09/2023, 5:46 PMLuke
02/09/2023, 5:48 PMCheqo
02/09/2023, 5:50 PM<div className="flex bg-red-400 w-full">something</div>
<Auth
supabaseClient={supabaseClient}
appearance={{
theme: ThemeSupa,
className: {
container: 'w-full'
}
}}
providers={['google', 'apple']}
/>
rem
02/09/2023, 6:11 PMJWTIssuedAtFuture
- postgres giving us PGRST301
(which from what I understand it means the JWT isn't valid WRT timing).
We've debugged it the point where it looks like the JWT is landing on supbase's side where the time is exactly the same - seconds-wise.
i.e. it reads as the same time - not in the future. But I'm guessing that supbase isn't accounting for sub-second issue to usage.
Besides putting in a 1 second delay (which would throttle every one of our request because we're doing auth checking on server side nav) - is there any solution or work around to this?somoni
02/09/2023, 6:31 PMColors
02/09/2023, 6:35 PMKong Error No API key found in request.
Hugos
02/09/2023, 6:38 PMLukas V
02/09/2023, 6:40 PMfast
02/09/2023, 6:56 PMTrey
02/09/2023, 6:57 PMfast
02/09/2023, 7:10 PMWizzel
02/09/2023, 7:31 PMdart
final existingFiles =
await Supabase.instance.client.storage.from('images').list(
path: Supabase.instance.client.auth.currentUser!.id,
);
but I noticed that I only got 100 files back, because that's the default limit for the `.list()`query.
I am curious why there is a limit. As far as I understand, the .list()
method only gets the metadata of the files and not the actual data, right? So is there a way to always get all file-names, no matter how many files there are in a bucket?
If yes, what are the downsides of doing that?MrAmG17
02/09/2023, 7:36 PMAllYourSupabase
02/09/2023, 7:45 PMTobiasBm
02/09/2023, 8:01 PMtype 'String' is not a subtype of type 'int' of 'index'
I am retrieving the uuid from as following:
dart
final userId = supabase.auth.currentUser?.id;
Which is a uuid as a String.
Then I try to stuck it into the query like so:
dart
final data = await supabase.from("profiles").select('*').eq('id', userId);
I have also tried without the * in select, same result.
Thank you helping me ๐Hugos
02/09/2023, 8:01 PMsomoni
02/09/2023, 8:10 PMDevThoughts
02/09/2023, 8:11 PMNinjaNuur
02/09/2023, 8:53 PMCREATE OR REPLACE FUNCTION public.handle_new_user() RETURNS trigger as $$ begin
insert into public.user (id, email, phone, first_name, last_name, role)
values (
new.id,
new.email,
new.phone,
new.raw_user_meta_data->>'first_name',
new.raw_user_meta_data->>'last_name',
CAST(new.raw_app_meta_data->>'role' as public.role)
) ON CONFLICT (id) DO
UPDATE
SET (email, phone, first_name, last_name, role) = (
new.email,
new.phone,
new.raw_user_meta_data->>'first_name',
new.raw_user_meta_data->>'last_name',
CAST(new.raw_app_meta_data->>'role' as public.role)
);
return new;
end;
$$ LANGUAGE plpgsql SECURITY definer;
When I create a new user the first_name and last_name that I pass through options are not copied over to public.user, even though they exist in auth.users table
const handleRegisterUser = () => {
supabaseClient.auth.signUp({
email: 'foo@gmail.com',
password: 'password',
options: {
data: {
firstName: 'John',
lastName: 'Doe',
},
},
})
}anthony-BH
02/09/2023, 9:27 PMconst {createClient} = require('@supabase/supabase-js')
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY)
exports.handler = async event => {
const {data, error} = await supabase.rpc('menu_json')
console.log(data, error)
return {
statusCode: 200,
body: JSON.stringify({
data: data,
error: error
})
}
}
I get the following error:
{
code: 'PGRST102',
details: null,
hint: null,
message: 'Content-Type not acceptable: application/json, text/plain'
}
Any help as to why its not working would be very much appreciated!CheesyNeesh
02/09/2023, 10:08 PMMathew
02/09/2023, 10:09 PM'tourist attraction' | 'museum' & !'rental' & !'agency' & !'operator'
'tourist attraction' | 'museum' & !'rental' | !'agency' | !'operator'
'tourist attraction' | 'museum' & (!'rental' | !'agency' | !'operator')
None of these seem to return results that match tourist attraction
or museum
but filter out ones that include rental
, agency
or operator
mchadwick
02/09/2023, 10:18 PMpetoma
02/09/2023, 10:24 PMCREATE SCHEMA IF NOT EXISTS private;
CREATE TABLE IF NOT EXISTS private.keys (
key text primary key not null,
value text
);
and
INSERT INTO private.keys (key, value) values ('SENDGRID_API_KEY', 'aaaaaaaaaa');
- Then I have added the send_email_message that is here: https://github.com/burggraf/supabase-mailer/blob/main/02_send_email_message.sql
- Finally I have added the send_email_sendgrid that I have here: https://github.com/burggraf/supabase-mailer/blob/main/02B_send_email_sendgrid.sql
So far so good. If I try the code:
SELECT public.send_email_sendgrid(
jsonb_build_object(
'recipient', 'example@email.com',
'sender', 'sender@email.com',
'subject', 'Prueba de correo electrรณnico',
'text_body', 'Texto de cuerpo',
'html_body', '<p>Cuerpo HTML</p>'
)
);
I receive the email. Thing is that I want the function to be triggered when a new row is added in one of my tables. I have the table "events" which has a field with a foreign key "user_id" which is linked to my table profiles where I can find "user_email". That would be the recipient. How could I create that trigger?
When I try to create it with the UI in Supabase, the function is not listed because it does not return a trigger but JSON.
Thanks!Le0n
02/09/2023, 10:51 PMtsx
useEffect(() => {
supabase.auth.getUser().then((response) => {
console.log(response)
})
}, [])
DDupasquier
02/09/2023, 11:06 PMmansedan
02/10/2023, 1:28 AMsql
create function leagues_by_date(start_date DATE, end_date DATE)
returns table (league_name TEXT, count integer) as $$
BEGIN
return QUERY select league_name,COUNT(*) as count
FROM events
WHERE date_event BETWEEN start_date AND end_date
GROUP BY league_name
ORDER BY league_name Desc;
END
$$ language plpgsql;
Then we call it like this:
sql
select * from leagues_by_date('2023-02-08', '2023-02-09')
Can anyone spot the error here for me? The league_name column is defined as 'text' in the table.sinrabo
02/10/2023, 3:16 AMdoug3465
02/10/2023, 3:56 AMVince
02/10/2023, 4:10 AM00:00
. Anything wrong with the code I used below?
if (blob != null) { // base64 streamed audio blob
const blobResponse = await supabase.storage
.from("my-storage-bucket")
.upload(mediaBlobUrl + '.wav', blob, { contentType: 'audio/wav' }); // mediaBlobUrl is the blob url generated
Screenshot is attached as well as seen in the storage bucket.