Gabriel Santos
08/13/2021, 6:52 PMLautaro Pereyra
08/13/2021, 6:55 PMGandalfG
08/13/2021, 7:17 PMKhan W
08/13/2021, 8:26 PMMaus
08/13/2021, 8:38 PMtouhidrahman
08/13/2021, 8:39 PMproducts
=========
id | name | categories
---|------|-------------------------------
1 | A | ["Men", "Shirts", "Business"]
2 | B | ["Women", "Dress", "Casual"]
Now, I would like to select only rows that contain category=Shirts
. How can I do that?Khan W
08/13/2021, 8:39 PMjavascript
const { data, error } = await supabase.from("products")
.select("*")
.contains("categories", ["Shirts"])
Khan W
08/13/2021, 8:40 PMtouhidrahman
08/13/2021, 8:42 PMKhan W
08/13/2021, 8:42 PMRB_Gaura
08/13/2021, 10:19 PMsoedirgo
08/14/2021, 3:24 AMbim
08/14/2021, 4:52 AMProtectedRoute
component that checks if there is a user logged in and whether the path is protected, and will router.push
to /login accordingly.
The issue im having is that after await supabase.signIn()
is called, I’m being redirected to my homepage, but after the redirect supabase.auth.user()
is still null
, and my ProtectedRoute
component is then redirecting back to /login. If I enter the url to go to the home page again, it won’t redirect me and user
is no longer null
.
In other posts I saw onAuthStateChange
suggested to be used. But I am already using an AuthProvider similar to the examples that utilise onAuthStateChange
. I think in my case it may be that the change in path is triggering a redirect before the user state is changed. But I'm not sure how to fix this.
I see in a few examples people redirect with getServerSideProps. But if I did this, wouldn't all of my pages would go from client side rendering to SSR, and I’m not sure if that would benefit me since I'm not interested in SEO. Although I’m not a fan of the loading page flash that occurs when a protected route is being client side redirected to the login page.pveyes
08/14/2021, 8:28 AMname (varchar)
and notes (text)
field and I wanted to use ilike
in name
and textSearch
in notes
?donpuerto
08/14/2021, 1:23 PM2% space milk
08/14/2021, 2:47 PMoe
08/14/2021, 6:17 PMflorian-lefebvre
08/14/2021, 7:21 PMoe
08/14/2021, 8:11 PM65536william
08/14/2021, 9:00 PMuser_id
(let's say), is there any way to INSERT a row and SELECT the uuid from the row you just inserted, without 'passing' the RLS policy?65536william
08/14/2021, 9:01 PMDi
08/14/2021, 9:10 PMShubham-Sinha
08/15/2021, 5:03 AMuser
08/15/2021, 6:56 AMflorian-lefebvre
08/15/2021, 8:17 AMjbergius
08/15/2021, 2:11 PMromlytech
08/15/2021, 2:22 PM// verify user is authenticated first
const token = event.headers.token;
const body = JSON.parse(event.body);
const { data: user, error: user_error } = await supabase.auth.api.getUser(
token
);
console.log(user);
if (user_error) {
return {
statusCode: error.status,
body: JSON.stringify({ message: error.message }),
};
}
jbergius
08/15/2021, 2:22 PMjbergius
08/15/2021, 2:24 PMromlytech
08/15/2021, 2:26 PM