Olyno
08/11/2022, 1:03 PMTheOnlyTails
08/11/2022, 1:56 PMidentify
and email
scopes, but i need the guilds
scope as well.
doing this doesn't seem to work:
ts
await supabase?.auth?.signIn(
{ provider: "discord" },
{
queryParams: {
scope: "guilds identify email",
},
}
)
I'm using the SvelteKit auth helper.Језда
08/11/2022, 2:00 PMMaxim Ens
08/11/2022, 2:43 PMplv8.execute('UPDATE...'
saying cannot execute UPDATE in a read-only transaction, code: 25006
drewbie
08/11/2022, 3:23 PMcreate policy "Products can only be updated by a shop admin or moderator"
ON public.products for UPDATE
USING (
user_belongs_to_shop(auth.uid(), shop_id)
AND
(
shop_user_has_role(auth.uid(), 'ADMIN'::user_shops_roles, id)
OR
shop_user_has_role(auth.uid(), 'MODERATOR'::user_shops_roles, id)
)
);
When I try to make an update that'll return false for the USING I get the following --> {"body": null, "count": null, "data": null, "error": [], "status": 404, "statusText": "Not Found"}
Im pretty sure its due to the function logic itself - which looks like this
RETURN EXISTS(SELECT 1 FROM public.user_shops
WHERE user_id = $1
AND shop_id = $3
AND role = $2);
I was assuming that RLS checks returning a boolean would fail/succeed the RLS policy and return a policy error vs a 404.
Appreciate anyone's help on this!hko
08/11/2022, 3:31 PMOnly POST and OPTIONS requests are supported
.
Obviously, the browser is invoking the function with a GET request. Are there any workarounds that could make those possible?InASunshineState
08/11/2022, 4:17 PMHEAVYPOLY
08/11/2022, 5:04 PMjordan801
08/11/2022, 6:29 PMsupabase secrets set test=test
Returns
Error: Unexpected error setting project secrets:
Temporary outage perhaps?thread carer
08/11/2022, 7:26 PMaccess_token
and refresh_token
for the respective Supabase tokens?Kellen Mace
08/11/2022, 8:01 PMBloxs
08/11/2022, 8:06 PMKasper
08/12/2022, 12:17 AMALTER TABLE public.pages
ALTER COLUMN branding boolean NOT NULL;
Result:
syntax error at or near "boolean"
jocarrito
08/12/2022, 2:08 AMKno Raziel
08/12/2022, 4:29 AM{
"error": "invalid_grant",
"error_description": "Invalid login credentials"
}
So when the user set the app to Spanish, I would like to display on the app "Creadenciales de acceso invalidos" instead of "Invalid login credentials", I have tried looking in the Supabase documentation and github repository for a documentation like this appendix from PostrgreSQL https://www.postgresql.org/docs/current/errcodes-appendix.html , so I could be able to use custom error messages depending on the error code but didn't find anything.RootKernel
08/12/2022, 9:27 AMprojectname
and bxhpalafcjvdrroyyver
sql
SELECT id, name FROM supabase.project;
rickysullivan
08/12/2022, 10:03 AMts
supabase
.from<Subscription>('subscriptions')
.select(
'*, prices(*, products(*)), postcodes:postcodes_subscription!postcodes_subscription_subscription_id_fkey(post_codes)'
)
.in('status', ['active']);
Results in:
js
...
"postcodes": [
{
"post_codes": "1234, 4567"
}
]
...
I really just want:
js
...
"postcodes": "1234, 4567"
...
49Ryann
08/12/2022, 11:23 AMvasek
08/12/2022, 11:53 AMSELECT
code_snippet_embed_telemetry.code_snippet_id cs_id,
code_snippet_embed_telemetry.type action_type,
COUNT(*) AS total
FROM code_snippet_embed_telemetry
INNER JOIN code_snippets on code_snippets.id = code_snippet_embed_telemetry.code_snippet_id
WHERE code_snippets.creator_id = 'string-that-will-be-passed-in-function'
GROUP BY cs_id, action_type;
Especially the INNER JOIN and GROUP BY part. Can anyone give me some hints?rankala
08/12/2022, 12:01 PM${date.getFullYear()}/${date.getMonth()}/${uuid()}.${file.fileObj.name.split('.').pop()}
in another part, i want a list of all files of path's in a bucket.
my guess, I need to do this:
const {data: files, error} = await supabase.storage.from('bucketid').list();
But here, i only get an id and a name, but not the full path. i am missing the year and month. So this list is kinda useless, because i cant resolve the year and month. How ca i get the path, without sending a request for each image to the database, after I recived the list?
Here is a sample result:
json
[{
"name": "Screenshot 2022-06-29 at 11.50.50.png",
"id": "d1f3bc38-6416-45a0-94cf-9d1a66116562",
"updated_at": "2022-08-09T21:13:31.048644+00:00",
"created_at": "2022-08-09T21:13:31.048644+00:00",
"last_accessed_at": "2022-08-09T21:13:31.048644+00:00",
"metadata": {
"size": 39662,
"mimetype": "image/png",
"cacheControl": "max-age=3600"
}
}]
Pierre_
08/12/2022, 12:09 PMpublic.profiles
table in the database:
sql
create table public.profiles (
id uuid references auth.users not null,
username text unique not null,
email text unique not null,
created_at timestamp with time zone,
updated_at timestamp with time zone,
avatar_url text,
primary key (id),
unique(username),
constraint username_length check (char_length(username) >= 3)
);
I therefore implemented RLS so that users are only allowed to edit their own profile:
sql
-- ...
create policy "Users can update their own profile." on public.profiles
for update using (auth.uid() = id);
-- ...
But, if I haven't missed anything, I guess users would be able to edit any column in their profile, including id
, email
, created_at
and updated_at
in this case. So what can I do to prevent that?
Thanks in advance for the help!zegoverno
08/12/2022, 3:52 PMGruce
08/12/2022, 4:16 PMn-glaz
08/12/2022, 5:54 PMmathewcst
08/12/2022, 9:19 PMjs
Type 'import("@supabase/auth-helpers-svelte/node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription").default' is not assignable to type 'import("@supabase/realtime-js/dist/module/RealtimeSubscription").default'.
The types of 'socket.channels' are incompatible between these types.
daviscup
08/13/2022, 2:33 AMawait supabase.auth.api.listUsers()
to get all users but I want to query only one specific user with their uid or email address.
In the docs, I've found only user()
and getUser()
which both seem to only get the user data of a currently logged in user.oofdere
08/13/2022, 6:58 AMlennard.
08/13/2022, 8:27 AMAzura
08/13/2022, 8:28 AMЈезда
08/13/2022, 9:32 AM