surya
09/06/2021, 12:19 PMAndy | Spillhosting.no
09/06/2021, 12:42 PMsilentworks
09/06/2021, 12:59 PMSUPABSEURL
some letters seem to be missing.Andy | Spillhosting.no
09/06/2021, 1:00 PMsilentworks
09/06/2021, 1:02 PMkailoon
09/06/2021, 3:15 PMuser
09/06/2021, 4:20 PMVERCEL_URL
environmental variable in the helpers.js file, which is the deployment URL, but that creates a bad experience for the users. For instance my domain is mathiass.io and when the user is finalising the purchase and decides to get redirected using the link where the arrow in the screenshot is pointing, they are ending up at the deployment URL which is similar to mathiass-io-1bdsf74wdfsfd65-mathiass.vercel.app. That means they are signed out, because they have never been to that URL before. An ideal outcome would be to get properly redirected to the account page, where they can confirm that they purchase went well.
`export const getURL = () => {
const url =
process?.env?.URL && process.env.URL !== ''
? process.env.URL
: process?.env?.VERCEL_URL && process.env.VERCEL_URL !== ''
? process.env.VERCEL_URL
: 'http://localhost:3000';
return url.includes('http') ? url : `https://${url}`;
};`
Would adding a variable be a good solution, or is there a better way of fixing it?florian-lefebvre
09/06/2021, 5:17 PMts
const { data, error } = await supabase
.from<Category>("categories")
.update({ parent_id: id })
.match({ id: el.id });
But I get a 404 error.
My categories
table has 3 columns: id
(int8, primary key), title
(varchar) and parent_id
(int8, nullable, foreign key that references the id of the same table).
I have RLS like so:
pgsql
alter table categories enable row level security;
create policy "Categories are viewable by everyone" on categories for select using ( true );
create policy "Any authenticated user can insert a category" on categories for insert with check ( auth.role() = 'authenticated' );
create policy "Any authenticated user can update a category" on categories for update with check ( auth.role() = 'authenticated' );
create policy "Any authenticated user can delete a category" on categories for delete using ( auth.role() = 'authenticated' );
So I don't understand what I'm doing wrongflorian-lefebvre
09/06/2021, 5:24 PMThomas B
09/06/2021, 6:11 PMcreate policy "Any authenticated user can update a category" on categories for update using (auth.role() = 'authenticated') with check (auth.role() = 'authenticated');
Michael Ketzer | streamgeist.com
09/06/2021, 7:39 PMThomas B
09/06/2021, 7:45 PMauth.role()
instead of role()
Michael Ketzer | streamgeist.com
09/06/2021, 7:47 PMauth.
is always removed when saving it...Thomas B
09/06/2021, 7:50 PMMichael Ketzer | streamgeist.com
09/06/2021, 7:51 PMALL
, at least that was what I thought. I added it manually now as query for SELECT
and selects do not allow `WITH CKECK`s. So I can only use the USING
there.
But yes, I want it for selectingThomas B
09/06/2021, 7:55 PMThomas B
09/06/2021, 7:55 PMMichael Ketzer | streamgeist.com
09/06/2021, 7:57 PMflorian-lefebvre
09/06/2021, 8:00 PMThomas B
09/06/2021, 8:06 PMauth.user()
/ or maybe changing the role text to something else than 'authenticated') ?
And you are totally sure you are using the public key and not the service key, right? π
- Also, it should not have anything to do with the public schema.Thomas B
09/06/2021, 8:06 PMMichael Ketzer | streamgeist.com
09/06/2021, 8:08 PMThomas B
09/06/2021, 8:15 PMMichael Ketzer | streamgeist.com
09/06/2021, 8:18 PMThomas B
09/06/2021, 8:21 PMMichael Ketzer | streamgeist.com
09/06/2021, 8:34 PMtinjaw
09/06/2021, 8:38 PMtinjaw
09/06/2021, 8:38 PMtinjaw
09/06/2021, 8:42 PMuser
09/06/2021, 8:49 PM