Hello! Currently building a React Native, Expo app with an express backend, using supabase auth.
I am able to (I believe) log a user in, when I create my session and export it throughout the app with useContext I'm able to see an access token, I pass this token to my backend in my authorization header as a bearer token
Authorization: `Bearer ${session?.access_token}
Authorization: `Bearer ${session?.access_token}
`, and it logs on my backend as well
However, when I call getUser(token) server side with express
Auth error: TypeError: Cannot read properties of undefined (reading 'getUser')
Auth error: TypeError: Cannot read properties of undefined (reading 'getUser')
I've reread the docs, and it says if you pass in access token it should be able to get the user. I've tried removing the token from getUser call and it has the same result. Any ideas?
I tested my RLS policies with impersonation and it worked, so I think it's because getUser is undefined and not finding the user that my issue is happening
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.