server-side database queries warning without session persist
I setup my app like a typical API where the client side auth is handled with Supabase OAUTH. Then it sends requests to backend, and my backend currently queries supabase. The reason for this is 1) i am a Front end dev so my knowledge of SQL is level 0.1 and 2) I do a decent amount of computation, or secondary queries on additional tables so I want to handle this on the server instead of mobile app JS code bundle. However, when I send my Auth token in the header from the client, and check on my server that the token is valid to ensure my API is secure, I get some warnings:
No storage option exists to persist the session, which may result in unexpected behavior when using auth.
and
If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.
and then i use supabase to check the session passed in the request header:
const user = await supabase.auth.getUser(req.headers.authorization);
const user = await supabase.auth.getUser(req.headers.authorization);
Is this flow "normal" for Supabase? Or with Supabase, is there any reason to send requests from my client side app, through my node/express backend, which handles the supabase server query as opposed to just doing it all on client side?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.